Skip to content

Wrong implicit quantification order with LinearTypes

Summary

GHC doesn't follow left-to-right order in implicit quantification of parametric by linearity arrow

Steps to reproduce

ghci> :set -XLinearTypes 
ghci> :set -fprint-explicit-foralls 
ghci> f :: a %p -> b; f = f
ghci> :t f
f :: forall a b (p :: Multiplicity). a %p -> b

Expected behavior

I expect implicit quantification to follow left-to-right order, so f should have type f :: forall a (p :: Multiplicity) b. a %p -> b

Environment

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