Skip to content

Instantly share code, notes, and snippets.

@hyone
Created October 29, 2012 13:56
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 hyone/3973701 to your computer and use it in GitHub Desktop.
Save hyone/3973701 to your computer and use it in GitHub Desktop.
Don't match type level arithmetic result with same literal value on GHC 7.6.1
-- $ ghci
-- GHCi, version 7.6.1: http://www.haskell.org/ghc/ :? for help
ghci> import GHC.TypeLits
ghci> :set -XDataKinds
ghci> :set -XPolyKinds
ghci> :set -XGADTs
ghci> data EqRefl a b where { Refl :: EqRefl a a }
ghci> :t Refl :: EqRefl 1 1
Refl :: EqRefl 1 1 :: EqRefl Nat 1 1
ghci> :set -XTypeOperators
ghci> :t Refl :: EqRefl 1 (0 + 1)
<interactive>:1:1:
Couldn't match type `0 + 1' with `1'
Expected type: EqRefl Nat 1 (0 + 1)
Actual type: EqRefl Nat 1 1
In the expression: Refl :: EqRefl 1 (0 + 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment