Skip to content

RankNTypes regression in GHC2021?

Summary

I have encountered an error when toying with RankNTypes that disappears when enabling Haskell2010. This is a tiny bit too hairy for me, as it looks at a glance like it has something to do with subsumption or polytypes, and i'm not familiar enough with them. But since, IIUC, the changes in 9.0 were supposed to make RankNTypes more permissive, this feels like a regression, hence opening this bug. The repro code is thankfully very short:

Steps to reproduce

code:

{-# LANGUAGE RankNTypes  #-}

a = x y

x :: (i -> forall p. p f i) -> i
x _ = undefined

y :: i -> (forall p f. p f i)
y = undefined

playground link: https://play.haskell.org/saved/wVsqibdl

Expected behavior

This compiles with -XHaskell2010, it feels like this should also compile with GHC2021?

Environment

  • GHC version used: 9.2.7
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information