Created
April 14, 2018 04:58
-
-
Save joneshf/2d1efe4d789c910e2a96ccbb7d590005 to your computer and use it in GitHub Desktop.
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
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