Skip to content

Instantly share code, notes, and snippets.

@parsonsmatt
Created May 8, 2018 16:34
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 parsonsmatt/b57ac2e95a2e913d2ff94030b6c8c1ba to your computer and use it in GitHub Desktop.
Save parsonsmatt/b57ac2e95a2e913d2ff94030b6c8c1ba to your computer and use it in GitHub Desktop.
```
λ> :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