[Haskell-cafe] Solved but strange error in type inference

Yves Parès limestrael at gmail.com
Wed Jan 4 14:59:14 CET 2012


> I don't see the point in universally quantifying over types which are
already present in the environment

I think it reduces the indeterminacy you come across when you read your
program ("where does this type variable come from, btw?")

> So is there anyway to "force" the scoping of variables, so that
> f :: a -> a
> f x = x :: a
> becomes valid?

You mean either than compiling with ScopedTypeVariables and adding the
explicit forall a. on f? I don't think.

2012/1/4 Brandon Allbery <allbery.b at gmail.com>
On Wed, Jan 4, 2012 at 08:41, Yves Parès <limestrael at gmail.com> wrote:

> Would you try:
>
> f :: a -> a
> f x = undefined :: a
>
> And tell me if it works? IMO it doesn't.

>  It won't

Apparently, Yucheng says it does.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120104/ad4f0d9f/attachment.htm>


More information about the Haskell-Cafe mailing list