Skip to content

The GHCi :type command seems to discard some type errors

Summary

The GHCi command :type will occasionally return an empty result.

Steps to reproduce

stack --resolver=lts-16.12 repl
Prelude> :set -XTypeApplications
Prelude> :type length
length :: Foldable t => t a -> Int
Prelude> :type length @[]
length @[] :: [a] -> Int
Prelude> :type length @Int  -- Notice the empty response
Prelude> length @Int
<interactive>:6:9: error:
    • Expected kind ‘* -> *’, but ‘Int’ has kind ‘*’
    • In the type ‘Int’
      In the expression: length @Int
      In an equation for ‘it’: it = length @Int

Expected behavior

The :type length @Int should produce an error.

Environment

  • GHC version used: GHC 8.8.4

Optional:

  • Operating System: OS x
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information