@@ -37,79 +37,79 @@ import Matryoshka.Class.Corecursive (class Corecursive, embed)
3737import Matryoshka.Class.Recursive (class Recursive , project )
3838import Matryoshka.Coalgebra (Coalgebra )
3939
40- type DistributiveLaw f g = ∀ a . f (g a ) → g (f a )
40+ type DistributiveLaw f g = forall a . f (g a ) -> g (f a )
4141
42- distApplicative ∷ ∀ f g . Traversable f ⇒ Applicative g ⇒ DistributiveLaw f g
42+ distApplicative :: forall f g . Traversable f => Applicative g => DistributiveLaw f g
4343distApplicative = sequence
4444
45- distDistributive ∷ ∀ f g . Traversable f ⇒ Distributive g ⇒ DistributiveLaw f g
45+ distDistributive :: forall f g . Traversable f => Distributive g => DistributiveLaw f g
4646distDistributive = distribute
4747
48- distCata ∷ ∀ f . Functor f ⇒ DistributiveLaw f Identity
48+ distCata :: forall f . Functor f => DistributiveLaw f Identity
4949distCata = wrap <<< map unwrap
5050
51- distPara ∷ ∀ t f . Corecursive t f ⇒ DistributiveLaw f (Tuple t )
51+ distPara :: forall t f . Corecursive t f => DistributiveLaw f (Tuple t )
5252distPara = distZygo embed
5353
5454distParaT
55- ∷ ∀ t f w
56- . Corecursive t f
57- ⇒ Comonad w
58- ⇒ DistributiveLaw f w
59- → DistributiveLaw f (EnvT t w )
55+ :: forall t f w
56+ . Corecursive t f
57+ => Comonad w
58+ => DistributiveLaw f w
59+ -> DistributiveLaw f (EnvT t w )
6060distParaT = distZygoT embed
6161
62- distZygo ∷ ∀ f a . Functor f ⇒ Algebra f a → DistributiveLaw f (Tuple a )
62+ distZygo :: forall f a . Functor f => Algebra f a -> DistributiveLaw f (Tuple a )
6363distZygo g m = Tuple (g (map fst m)) (map snd m)
6464
6565distZygoT
66- ∷ ∀ f w a
67- . Functor f
68- ⇒ Comonad w
69- ⇒ Algebra f a
70- → DistributiveLaw f w
71- → DistributiveLaw f (EnvT a w )
66+ :: forall f w a
67+ . Functor f
68+ => Comonad w
69+ => Algebra f a
70+ -> DistributiveLaw f w
71+ -> DistributiveLaw f (EnvT a w )
7272distZygoT g k fe =
7373 EnvT $ Tuple (g (fst <<< runEnvT <$> fe)) (k (lower <$> fe))
7474
75- distHisto ∷ ∀ f . Functor f ⇒ DistributiveLaw f (Cofree f )
75+ distHisto :: forall f . Functor f => DistributiveLaw f (Cofree f )
7676distHisto = distGHisto identity
7777
7878distGHisto
79- ∷ ∀ f h
80- . Functor f
81- ⇒ Functor h
82- ⇒ DistributiveLaw f h
83- → DistributiveLaw f (Cofree h )
79+ :: forall f h
80+ . Functor f
81+ => Functor h
82+ => DistributiveLaw f h
83+ -> DistributiveLaw f (Cofree h )
8484distGHisto k = unfoldCofree (map extract) (k <<< map tail)
8585
86- distAna ∷ ∀ f . Functor f ⇒ DistributiveLaw Identity f
86+ distAna :: forall f . Functor f => DistributiveLaw Identity f
8787distAna = map wrap <<< unwrap
8888
89- distApo ∷ ∀ t f . Recursive t f ⇒ DistributiveLaw (Either t ) f
89+ distApo :: forall t f . Recursive t f => DistributiveLaw (Either t ) f
9090distApo = distGApo project
9191
92- distGApo ∷ ∀ f a . Functor f ⇒ Coalgebra f a → DistributiveLaw (Either a ) f
92+ distGApo :: forall f a . Functor f => Coalgebra f a -> DistributiveLaw (Either a ) f
9393distGApo f = either (map Left <<< f) (map Right )
9494
9595distGApoT
96- ∷ ∀ f m a
97- . Functor f
98- ⇒ Functor m
99- ⇒ Coalgebra f a
100- → DistributiveLaw m f
101- → DistributiveLaw (ExceptT a m ) f
96+ :: forall f m a
97+ . Functor f
98+ => Functor m
99+ => Coalgebra f a
100+ -> DistributiveLaw m f
101+ -> DistributiveLaw (ExceptT a m ) f
102102distGApoT g k = map ExceptT <<< k <<< map (distGApo g) <<< runExceptT
103103
104- distFutu ∷ ∀ f . Functor f ⇒ DistributiveLaw (Free f ) f
104+ distFutu :: forall f . Functor f => DistributiveLaw (Free f ) f
105105distFutu = distGFutu identity
106106
107107distGFutu
108- ∷ ∀ f h
109- . Functor f
110- ⇒ Functor h
111- ⇒ DistributiveLaw h f
112- → DistributiveLaw (Free h ) f
108+ :: forall f h
109+ . Functor f
110+ => Functor h
111+ => DistributiveLaw h f
112+ -> DistributiveLaw (Free h ) f
113113distGFutu k f = case resume f of
114- Left as → join <<< liftF <$> k (distGFutu k <$> as)
115- Right b → pure <$> b
114+ Left as -> join <<< liftF <$> k (distGFutu k <$> as)
115+ Right b -> pure <$> b
0 commit comments