Skip to content

Instantly share code, notes, and snippets.

@exterm
Created March 6, 2013 20:56
Show Gist options
  • Save exterm/5102979 to your computer and use it in GitHub Desktop.
Save exterm/5102979 to your computer and use it in GitHub Desktop.
Example for Phantom Types in Haskell
data PList a b = Nil
| Cons a (PList a b)
test :: PList Int String
test = Cons 3 $ Cons 2 $ Cons 1 Nil
data Foo = Foo
test2 :: PList Int Foo
test2 = Cons 3 $ Cons 2 $ Cons 1 Nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment