I'm struggling with Haskell. I have defined a few data types which make sense in...
Bartosz Milewski @BartoszMilewski@mathstodon.xyz
I'm struggling with Haskell. I have defined a few data types which make sense in category theory:
newtype Yoneda a x =
Yo { unYo :: x -> a }
newtype Companion ff a f =
Co { unCo :: forall x. ff a x -> f x }
newtype E f a =
E { unE :: Companion Yoneda a f }
I would prefer to get rid of all the wrapping/unwrapping of isomorphic data types, but I often have to use them partially applied. Unfortunately that precludes the use of type synonyms. Are there any tricks that I could use?