Skip to content

Instantly share code, notes, and snippets.

@max630
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save max630/d192ad3bb652c6e6962e to your computer and use it in GitHub Desktop.
Save max630/d192ad3bb652c6e6962e to your computer and use it in GitHub Desktop.
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