[Haskell-cafe] ScopedTypeVariables

Dan Doel dan.doel at gmail.com
Tue Aug 6 21:11:48 CEST 2013

This is already a separate extension: PatternSignatures. However, that
extension is deprecated for some reason.

On Tue, Aug 6, 2013 at 2:46 PM, Evan Laforge <qdunkan at gmail.com> wrote:

> Occasionally I have to explicitly add a type annotation, either for
> clarity or to help choose a typeclass instance.  Usually top-level
> type annotations take care of this, but sometimes it's convenient to
> only annotate a certain value, e.g. one argument of a lambda.
> I've noticed that while vanilla haskell is happy to allow me to put
> type annotations on variables where they are used (e.g. '\x -> f (x ::
> T)'), if I put it on the variable where it is bound (e.g. '\(x :: T)
> -> f x'), it wants me to turn on ScopedTypeVariables.
> I think ScopedTypeVariables is a nice extension and I'm sure it comes
> from a perfectly respectable family and all, but it feels like
> annotations on arguments comes in as a side-effect.
> Would it make sense to split it into a separate extension like
> TypesOnArguments so I can more accurately express my deviation from
> haskell2010 orthodoxy?  Or is there some deeper tie between scoped
> type variables and annotations on arguments?
> Now that I think of it, it seems inconsistent that 'x :: A -> B; x a =
> ...' is valid, but 'x = \(a :: A) -> (...) :: B' is not.  Doesn't the
> former desugar to the latter?
> And what about getting ScopedTypeVariables into haskell prime?  As far
> as I know everyone loves it, or at least no one actually hates it :)
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130806/c2198cc1/attachment.htm>

More information about the Haskell-Cafe mailing list