Last active
August 29, 2015 14:21
-
-
Save max630/d192ad3bb652c6e6962e 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
Prelude> data Foo = Foo | |
Prelude> data Bar = Bar | |
Prelude> data Baz = Baz | |
Prelude> data DoesntHave | |
Prelude> data Has | |
Prelude> data MyXml:: * -> * -> * -> * where { DFoo :: Foo -> MyXml Has a b; DBar :: Bar -> MyXml a Has b; DBaz :: Baz -> MyXml a b Has } | |
Prelude> :t [DFoo Foo, DBaz Baz] | |
[DFoo Foo, DBaz Baz] :: [MyXml Has a Has] | |
Prelude> let a = DBar Bar :: MyXml Has DoesntHave Has | |
<interactive>:28:9: | |
Couldn't match expected type `DoesntHave' with actual type `Has' | |
Expected type: MyXml Has DoesntHave Has | |
Actual type: MyXml Has Has b0 | |
In the return type of a call of `DBar' | |
In the expression: DBar Bar :: MyXml Has DoesntHave Has | |
Prelude> let a = DBaz Baz :: MyXml Has DoesntHave Has | |
Prelude> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment