Created
May 19, 2018 23:36
-
-
Save hadronized/1165b7e252c4e4f89a143df92c7d8d56 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE RankNTypes #-} | |
-- A natural transformation. | |
data NT f g = NT { nt :: forall a. f a -> g a } | |
-- Natural transformation from Maybe to []. | |
maybeListNT :: NT Maybe [] | |
maybeListNT = NT (maybe [] pure) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can test it with:
Which yields