ЗП
<*>
будетSize: a a a
ЗП
<*>
будетOℕ
Splice: (f Free f a, Day f f a -> Free f b) -> Free f b
Oℕ
Oℕ
Oℕ
ЗП
Compose f f ~> Day f f
?Oℕ
Compose f f ~> Day f f
?ЗП
ЗП
Day f g ~> Comp f g
NI
Oℕ
Oℕ
ЗП
data Y p f a where
Y :: p b a -> f b -> Y p f a
type Day2 f g a = Y (Cayley g (->)) f a
type CoyonedaBind2 f g a = Y (Star g) f a
fromCoyonedaBind2ToCompose :: forall f g. Functor f => CoyonedaBind2 f g ~> Compose f g
fromCoyonedaBind2ToCompose (Y (Star bfa) gb) = Compose (fmap bfa gb)
fromComposeToCoyonedaBind2 :: forall f g. Compose f g ~> CoyonedaBind2 f g
fromComposeToCoyonedaBind2 (Compose fga) = Y (Star id) fga
fromCoyonedaDayToCoyonedaBind2 :: forall f g. Functor g => Day2 f g ~> CoyonedaBind2 f g
fromCoyonedaDayToCoyonedaBind2 (Y (Cayley pba) gb) = Y (Star (\b -> fmap ($ b) pba)) gb
Oℕ
data Y p f a where
Y :: p b a -> f b -> Y p f a
type Day2 f g a = Y (Cayley g (->)) f a
type CoyonedaBind2 f g a = Y (Star g) f a
fromCoyonedaBind2ToCompose :: forall f g. Functor f => CoyonedaBind2 f g ~> Compose f g
fromCoyonedaBind2ToCompose (Y (Star bfa) gb) = Compose (fmap bfa gb)
fromComposeToCoyonedaBind2 :: forall f g. Compose f g ~> CoyonedaBind2 f g
fromComposeToCoyonedaBind2 (Compose fga) = Y (Star id) fga
fromCoyonedaDayToCoyonedaBind2 :: forall f g. Functor g => Day2 f g ~> CoyonedaBind2 f g
fromCoyonedaDayToCoyonedaBind2 (Y (Cayley pba) gb) = Y (Star (\b -> fmap ($ b) pba)) gb
ЗП
Day f g ~> Compose f g
ЗП
Oℕ
Oℕ
foo :: f ~> Foo fв начальной форме, а не что-то вроде
instance Applicative f => Monad (Foo f)
fooFoldMap :: (Monad g, Applicative f) => (forall a. f a -> g a) -> Foo f b -> g b
newtype FreeMon' f a =
FreeMon'
(forall g. (Monad g, Applicative f) =>
(forall b. f b -> g b) -> g a)
Oℕ
ЗП
foo :: f ~> Foo fв начальной форме, а не что-то вроде
instance Applicative f => Monad (Foo f)
fooFoldMap :: (Monad g, Applicative f) => (forall a. f a -> g a) -> Foo f b -> g b
newtype FreeMon' f a =
FreeMon'
(forall g. (Monad g, Applicative f) =>
(forall b. f b -> g b) -> g a)