1 {-# LANGUAGE DataKinds, TypeOperators, GADTs #-}
9 Fsucc
:: Fin n
-> Fin
(n
+ 1)
14 {- Only the second error is legitimate.
17 The Glorious Glasgow Haskell Compilation System, version 7.8.2
18 % ghc -ignore-dot-ghci /tmp/Error.hs
19 [1 of 1] Compiling Error ( /tmp/Error.hs, /tmp/Error.o )
22 Couldn't match type ‘0’ with ‘1’
24 Actual type: Fin (0 + 1)
25 In the expression: Fsucc Fzero
26 In an equation for ‘test’: test = Fsucc Fzero
29 Couldn't match type ‘1’ with ‘0’
31 Actual type: Fin (0 + 1)
32 In the first argument of ‘Fsucc’, namely ‘Fzero’
33 In the expression: Fsucc Fzero