Skip to content

Instantly share code, notes, and snippets.

@parsonsmatt parsonsmatt/lol
Created May 8, 2018

Embed
What would you like to do?
```
λ> :set -XPolyKinds -XKindSignatures
λ> undefined :: forall (a :: ka) (b :: kb) (c :: k1 -> k2 -> *). c a b -> c b a
<interactive>:2:61: error:
Illegal symbol '.' in type
Perhaps you intended to use RankNTypes or a similar language
extension to enable explicit-forall syntax: forall <tvs>. <type>
λ> :set -XRankNTypes
λ> undefined :: forall (a :: ka) (b :: kb) (c :: k1 -> k2 -> *). c a b -> c b a
<interactive>:4:65: error:
• Expected kind ‘k1’, but ‘a’ has kind ‘ka’
• In the first argument of ‘c’, namely ‘a’
In an expression type signature:
forall (a :: ka) (b :: kb) (c :: k1 -> k2 -> *). c a b -> c b a
In the expression:
undefined ::
forall (a :: ka) (b :: kb) (c :: k1 -> k2 -> *). c a b -> c b a
<interactive>:4:74: error:
• Expected kind ‘k1’, but ‘b’ has kind ‘kb’
• In the first argument of ‘c’, namely ‘b’
In an expression type signature:
forall (a :: ka) (b :: kb) (c :: k1 -> k2 -> *). c a b -> c b a
In the expression:
undefined ::
forall (a :: ka) (b :: kb) (c :: k1 -> k2 -> *). c a b -> c b a
λ> undefined :: forall (a :: ka) (b :: kb) (c :: forall k1 k2. k1 -> k2 -> *). c a b -> c b a
<interactive>:5:47: error:
Illegal kind: forall k1 k2. k1 -> k2 -> *
Did you mean to enable TypeInType?
λ> :set -XTypeInType
λ> undefined :: forall (a :: ka) (b :: kb) (c :: forall k1 k2. k1 -> k2 -> *). c a b -> c b a
<interactive>:7:73: error:
Not in scope: type constructor or class ‘*’
NB: With TypeInType, you must import * from Data.Kind
<interactive>:7:73: error:
Illegal operator ‘*’ in type ‘*’
Use TypeOperators to allow operators in types
<interactive>:7:73: error: Operator applied to too few arguments: *
λ> import Data.Kind
λ> undefined :: forall (a :: ka) (b :: kb) (c :: forall k1 k2. k1 -> k2 -> *). c a b -> c b a
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.