. :
type f ~> g = forall a . f a -> g a
, , ( , ) f g. f ~> g f a . ( , , , Ralf Hinze, ), .
:
{-# LANGUAGE RankNTypes, TypeOperators #-}
type f ~> g = forall a . f a -> g a
data Two g a = Two (g a) (g a)
data Foo f a = This (f a)
| That (Foo (Two f) a)
hello :: (f ~> g) -> Foo f a -> Foo g a
hello t (This fa) = This (t fa)
hello t (That buh) =
That (hello (\(Two x y) -> Two (t x) (t y)) buh)
hello f g, * -> *. &; , * .
& dagger; , PolyKinds, f g k -> *.