Module
Data.Distributive
- Package
- distributive
- Repository
- purescript/purescript-distributive
#Distributive Source
class Distributive :: (Type -> Type) -> Constraintclass (Functor f) <= Distributive f where
Categorical dual of Traversable:
distributeis the dual ofsequence- it zips an arbitrary collection of containers.collectis the dual oftraverse- it traverses an arbitrary collection of values.
Laws:
distribute = collect identitydistribute <<< distribute = identitycollect f = distribute <<< map fmap f = unwrap <<< collect (Identity <<< f)map distribute <<< collect f = unwrap <<< collect (Compose <<< f)
Members
distribute :: forall a g. Functor g => g (f a) -> f (g a)collect :: forall a b g. Functor g => (a -> f b) -> g a -> f (g b)
Instances
Distributive IdentityDistributive (Function e)(TypeEquals a Unit) => Distributive (Tuple a)
#distributeDefault Source
distributeDefault :: forall a f g. Distributive f => Functor g => g (f a) -> f (g a)A default implementation of distribute, based on collect.
#collectDefault Source
collectDefault :: forall a b f g. Distributive f => Functor g => (a -> f b) -> g a -> f (g b)A default implementation of collect, based on distribute.
#cotraverse Source
cotraverse :: forall a b f g. Distributive f => Functor g => (g a -> b) -> g (f a) -> f bZip an arbitrary collection of containers and summarize the results
- Modules
- Data.
Distributive