We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We wind up with a nominal role for the 'm' parameter, because it occurs inside f in the body of FT
nominal
f
FT
newtype FT f m a = FT { runFT :: forall r. (a -> m r) -> (f (m r) -> m r) -> m r }
We should be able to achieve representational by smashing that occurrence of f with Yoneda.
representational
newtype FT f m a = FT { runFT :: forall r. (a -> m r) -> (forall x. (x -> m r) -> f x -> m r) -> m r }
This is the same trick that drives the Mendler-style catamorphism.
The text was updated successfully, but these errors were encountered:
@ekmett Just for my own edification, wouldn't "smashing the occurrence of f" involve the following conversion?
fwd :: Functor f => f x -> (forall y. (x -> y) -> f y) fwd fx = \xy -> fmap xy fx
If we're smashing f (m r) specifically, plug and chugging converts the following:
f (m r)
to:
newtype FT f m a = FT { runFT :: forall r. (a -> m r) -> ((forall x. ((m r) -> x) -> f x) -> m r) -> m r }
Is there some further isomorphism that produces the type you have above?
Sorry, something went wrong.
No branches or pull requests
We wind up with a
nominal
role for the 'm' parameter, because it occurs insidef
in the body ofFT
We should be able to achieve
representational
by smashing that occurrence off
with Yoneda.This is the same trick that drives the Mendler-style catamorphism.
The text was updated successfully, but these errors were encountered: