What are the downsides to ScopedTypeVariables
, if there are any? Why isn't it on by default? Does it lead to worse inference? Are there edge cases where it fails? Is it significantly harder to implement in GHC?
It's also because it changes the semantics of a program (combined with other extensions). Consider
{-# LANGUAGE RankNTypes #-}
foo :: forall a . (a -> a) -> (a -> a)
foo = bar
where
bar :: a -> a
bar = id
It compiles fine, but with ScopedTypeVariables
it even fails to compile.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With