Skip to content

Instantly share code, notes, and snippets.

@joneshf
Created April 14, 2018 04:58
Show Gist options
  • Save joneshf/2d1efe4d789c910e2a96ccbb7d590005 to your computer and use it in GitHub Desktop.
Save joneshf/2d1efe4d789c910e2a96ccbb7d590005 to your computer and use it in GitHub Desktop.
module Main (class Foo, foo, BProxy) where
foreign import kind Boolean
foreign import data False :: Boolean
foreign import data True :: Boolean
data BProxy (boolean :: Boolean)
= BProxy
class Foo (boolean :: Boolean) a | boolean -> a where
foo :: BProxy boolean -> a
instance fooTrue :: Foo True Int where
foo _ = 0
instance fooa :: Foo False String where
foo _ = ""
instance foob :: Foo False Int where
foo _ = 1
foo1 :: String
foo1 = foo (BProxy :: BProxy False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment