Skip to content

Kind error when using partial type signatures

Summary

When using a partial type signature I get a kind error, which is surprising.

Steps to reproduce

Compile the following module. The function bar type checks, whereas baz gets a kind error

{-# LANGUAGE RankNTypes #-}
module Bug where

foo :: (Functor g) =>
       (forall aa . Num aa => f aa -> g aa) ->
       f a -> g (f a)
foo f x = undefined

bar :: (forall aa . Num aa => f aa -> Int -> aa) ->
       f a -> Int -> f a
bar f = foo f

baz :: (forall aa . Num aa => f aa -> Int -> aa) ->
       f a -> _ -> f a
baz f = foo f

Environment

  • GHC version used:

The Glorious Glasgow Haskell Compilation System, version 8.10.1

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information