Created
January 30, 2019 16:28
-
-
Save ch3pjw/5501613a4cf8c19901b69907c3689fbd to your computer and use it in GitHub Desktop.
Unpacking using type family
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 TypeFamilies #-} | |
module Main where | |
type family Sneaky a where | |
Sneaky (Maybe x) = x -> IO (Maybe x) | |
go :: Sneaky (Maybe Char) | |
go = return . Just | |
main :: IO () | |
main = go 'a' >>= print |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment