unfoldable-restricted-0.0.2: An alternative to the Unfoldable typeclass

Safe HaskellSafe
LanguageHaskell2010

Data.Unfoldable.Restricted

Contents

Synopsis

Unfoldable

class UnfoldableR pred t | t -> pred where Source

Methods

unfoldRestrict :: (pred a, Unfolder f) => f a -> f (t a) Source

unfoldRestrict_ :: (UnfoldableR Unit t, Unfolder f) => f (t ()) Source

unfoldRestrictBF :: (UnfoldableR p t, Unfolder f, p a) => f a -> f (t a) Source

unfoldRestrictBF_ :: (UnfoldableR Unit t, Unfolder f) => f (t ()) Source

unfoldrRestrict :: (UnfoldableR p t, p a) => (b -> Maybe (a, b)) -> b -> Maybe (t a) Source

fromList :: (UnfoldableR p t, p a) => [a] -> Maybe (t a) Source

leftMost :: UnfoldableR Unit t => Maybe (t ()) Source

rightMost :: UnfoldableR Unit t => Maybe (t ()) Source

allDepthFirst :: UnfoldableR Unit t => [t ()] Source

allToDepth :: UnfoldableR Unit t => Int -> [t ()] Source

allBreadthFirst :: UnfoldableR Unit t => [t ()] Source

Biunfoldable

class BiunfoldableR predA predB t | t -> predA predB where Source

Methods

biunfoldRestrict :: (predA a, predB b, Unfolder f) => f a -> f b -> f (t a b) Source

biunfoldRestrict_ :: (BiunfoldableR Unit Unit t, Unfolder f) => f (t () ()) Source

biunfoldRestrictBF :: (BiunfoldableR p q t, Unfolder f, p a, q b) => f a -> f b -> f (t a b) Source

biunfoldRestrictBF_ :: (BiunfoldableR Unit Unit t, Unfolder f) => f (t () ()) Source

biunfoldrRestrict :: (BiunfoldableR p q t, p a, q b) => (c -> Maybe (a, c)) -> (c -> Maybe (b, c)) -> c -> Maybe (t a b) Source

fromLists :: (BiunfoldableR p q t, p a, q b) => [a] -> [b] -> Maybe (t a b) Source

Utils

class (Hashable a, Eq a) => Hashable' a Source

Instances