Skip to content

Instantly share code, notes, and snippets.

@philopon
Last active August 29, 2015 14:12
Show Gist options
  • Select an option

  • Save philopon/cc7fec333a8fa011a8be to your computer and use it in GitHub Desktop.

Select an option

Save philopon/cc7fec333a8fa011a8be to your computer and use it in GitHub Desktop.
module Test where
foreign import data A :: *
foreign import data C :: *
foreign import data B :: *
newtype Test (a :: #*) = Test String
a :: Test (a :: A)
a = Test "neko"
b :: Test (a :: A, b :: B)
b = Test "neko"
c :: Test (c :: C)
c = Test "nyan"
test :: forall e. Test (a :: A | e) -> String
test (Test a) = a
testA :: String
testA = test a
testB :: String
testB = test b
-- testC = test c -- compile error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment