RequiredTypeArguments does not imply ExplicitForAll

I just don’t get it, is it a bug? The latter is necessitated by the former.

1 Like

forall var. is invisible quantification, and forall var -> is visible quantification they are different things the fact they both use forall is immaterial the is no difference from the hypothetical case where ìnvisible quantification uses forallI var. and visible quantification uses forallV var. it is only a bug if you can’t write something like

{-# LANGUAGE RequiredTypeArguments #-}
import Foreign

mySizeOf :: forall s -> Storable s => Int
mySizeOf myType = sizeOf (undefined :: myType)

main :: IO ()
main = print $ mySizeOf Int

EDIT: nevermind if i use NoExplicitForAll it doesn’t compile which is a bug.

2 Likes

How can I get it fixed? Is there already a ticket?

ghc issues should be reported on the ghc gitlab Issues · Glasgow Haskell Compiler / GHC · GitLab

I think it’s fair to call this a bug.

It wasn’t caught during development because ExplicitForAll is included in GHC2021, which is the default nowadays, and you need to explicitly specify Haskell98 or Haskell2010 to observe the issue.

The patch to fix this should be trivial, would you like to submit one?

1 Like

Not really, I’m kind of scared of all things to you related after I tried to investigate how to make a plugin, I just wanted to bring it to someone’s attention.