Skip to content

Instantly share code, notes, and snippets.

@ch3pjw
Created January 30, 2019 16:28
Show Gist options
  • Save ch3pjw/5501613a4cf8c19901b69907c3689fbd to your computer and use it in GitHub Desktop.
Save ch3pjw/5501613a4cf8c19901b69907c3689fbd to your computer and use it in GitHub Desktop.
Unpacking using type family
{-# 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