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

Safe HaskellSafe
LanguageHaskell2010

Data.Unfoldable.Restricted

Contents

Synopsis

Unfoldable

class UnfoldableR pred t | t -> pred where #

Minimal complete definition

unfoldRestrict

Methods

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

Instances

UnfoldableR Ord Set # 

Methods

unfoldRestrict :: (Ord a, Unfolder f) => f a -> f (Set a) #

UnfoldableR Unit [] # 

Methods

unfoldRestrict :: (Unit a, Unfolder f) => f a -> f [a] #

UnfoldableR Unit Maybe # 

Methods

unfoldRestrict :: (Unit a, Unfolder f) => f a -> f (Maybe a) #

UnfoldableR Unit Identity # 

Methods

unfoldRestrict :: (Unit a, Unfolder f) => f a -> f (Identity a) #

UnfoldableR Hashable' HashSet # 

Methods

unfoldRestrict :: (Hashable' a, Unfolder f) => f a -> f (HashSet a) #

(Bounded a, Enum a) => UnfoldableR Unit (Either a) # 

Methods

unfoldRestrict :: (Unit a, Unfolder f) => f a -> f (Either a a) #

(Bounded a, Enum a) => UnfoldableR Unit ((,) a) # 

Methods

unfoldRestrict :: (Unit a, Unfolder f) => f a -> f (a, a) #

UnfoldableR p f => UnfoldableR p (Reverse * f) # 

Methods

unfoldRestrict :: (p a, Unfolder f) => f a -> f (Reverse * f a) #

(Bounded a, Enum a) => UnfoldableR Unit (Constant * a) # 

Methods

unfoldRestrict :: (Unit a, Unfolder f) => f a -> f (Constant * a a) #

(UnfoldableR p f, UnfoldableR p g) => UnfoldableR p (Sum * f g) # 

Methods

unfoldRestrict :: (p a, Unfolder f) => f a -> f (Sum * f g a) #

(UnfoldableR p f, UnfoldableR p g) => UnfoldableR p (Product * f g) # 

Methods

unfoldRestrict :: (p a, Unfolder f) => f a -> f (Product * f g a) #

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

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

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

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

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

Biunfoldable

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

Minimal complete definition

biunfoldRestrict

Methods

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

Instances

BiunfoldableR Ord Unit Map # 

Methods

biunfoldRestrict :: (Ord a, Unit b, Unfolder f) => f a -> f b -> f (Map a b) #

BiunfoldableR Unit Unit Either # 

Methods

biunfoldRestrict :: (Unit a, Unit b, Unfolder f) => f a -> f b -> f (Either a b) #

BiunfoldableR Unit Unit (,) # 

Methods

biunfoldRestrict :: (Unit a, Unit b, Unfolder f) => f a -> f b -> f (a, b) #

BiunfoldableR Hashable' Unit HashMap # 

Methods

biunfoldRestrict :: (Hashable' a, Unit b, Unfolder f) => f a -> f b -> f (HashMap a b) #

BiunfoldableR Unit Unit (Constant *) # 

Methods

biunfoldRestrict :: (Unit a, Unit b, Unfolder f) => f a -> f b -> f (Constant * a b) #

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

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

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

Utils

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

Instances

(Hashable a, Eq a) => Hashable' a # 
UnfoldableR Hashable' HashSet # 

Methods

unfoldRestrict :: (Hashable' a, Unfolder f) => f a -> f (HashSet a) #

BiunfoldableR Hashable' Unit HashMap # 

Methods

biunfoldRestrict :: (Hashable' a, Unit b, Unfolder f) => f a -> f b -> f (HashMap a b) #