
Dear all, (this is a rant - please ignore) why has "PatternSignatures" been renamed to "ScopedTypeVariables" (in ghc-6.10)? show me the alleged "type variable" in this code: do x :: Int <- [ 1 .. 10 ] ; return $ x^2 and why on earth do I need to use a language extension at all to get to the most basic thing of declarative programming: to declare the type of an identifier? This seriously hurts (me, at least) when teaching Haskell. Thanks - J.W.

Hi,
why has "PatternSignatures" been renamed to "ScopedTypeVariables" (in ghc-6.10)?
It's unfortunate that 6.8 doesn't have ScopedTypeVariables and 6.10 warns on PatternSignatures. It would have been nice if you could support N.M and N.M+2 with the same code without having to turn off warnings.
show me the alleged "type variable" in this code: do x :: Int <- [ 1 .. 10 ] ; return $ x^2
and why on earth do I need to use a language extension at all to get to the most basic thing of declarative programming: to declare the type of an identifier?
Because it isn't in Haskell 98, and GHC (very kindly) only accepts Haskell 98 by default. By doing so they've kept the standard alive, and we should be very grateful for this. I think this is a guaranteed feature for H', it's really an oversight that it isn't in H98. Thanks Neil

[...] and GHC (very kindly) only accepts Haskell 98 by default.
as in, hierarchical modules? continuing the rant, I'd say that "ScopedTypeVariables" is a kludge that tries to repair another hack, namely, allowing to not declare type variables. That's again counter to the very idea of declarative programming. I mean, if we'd write let f1 :: forall a . T1 a f1 = let f2 :: forall a . T2 a f3 :: T3 a in ... in ... then there'd be no need to look up the meaning of the inner a's in some command line option or pragma in the file header, both of which are miles away from the source location. (I already said it is a rant, OK?) - J.W.

On Wed, 8 Apr 2009, Johannes Waldmann wrote:
Dear all, (this is a rant - please ignore)
why has "PatternSignatures" been renamed to "ScopedTypeVariables" (in ghc-6.10)?
show me the alleged "type variable" in this code: do x :: Int <- [ 1 .. 10 ] ; return $ x^2
and why on earth do I need to use a language extension at all to get to the most basic thing of declarative programming: to declare the type of an identifier?
This would work: do x <- [ 1 .. 10 ] ; return $ (x::Int)^2 but I assume, that you want to declare the type on binding, right?

Hi Johannes, Am Mittwoch, den 08.04.2009, 03:00 +0000 schrieb Johannes Waldmann:
Dear all, (this is a rant - please ignore)
why has "PatternSignatures" been renamed to "ScopedTypeVariables" (in ghc-6.10)?
show me the alleged "type variable" in this code: do x :: Int <- [ 1 .. 10 ] ; return $ x^2
and why on earth do I need to use a language extension at all to get to the most basic thing of declarative programming: to declare the type of an identifier?
This seriously hurts (me, at least) when teaching Haskell.
I agree, and it has bothered me for quite a while. But better late than never: https://github.com/ghc-proposals/ghc-proposals/pull/119 If if this still seriously hurts you, feel free to express your support in the proposal. Cheers, Joachim -- Joachim Breitner mail@joachim-breitner.de http://www.joachim-breitner.de/
participants (4)
-
Henning Thielemann
-
Joachim Breitner
-
Johannes Waldmann
-
Neil Mitchell