[core libraries] Re: Tightening up on inferred type signatures
Niklas Haas
haskell at nand.wakku.to
Tue Apr 22 06:49:20 UTC 2014
On Tue, 22 Apr 2014 06:44:26 +0000, Simon Peyton Jones <simonpj at microsoft.com> wrote:
> | Independent of language extensions, what about types and classes whose
> | names are not in scope. Is there an implicit "... if you import all
> | the relevant symbols" and the end of the rule?
>
> Good point. I'm honestly unsure how far to push this one! (It'd be relatively easy to check whether they were in scope and complain if not, but ...)
>
> Simon
My stance on this is that, without the appropriate names in scope, you
are actually specifying a different type signature to the one that GHC
inferred (or none at all, if the names are unbound) - so this rule
doesn't cover.
The ruling that it would be valid, had you specified the precise signature
GHC inferred is not broken, because you're actually specifying a
different signature.
Meanwhile, in the case of FlexibleContexts etc. you are actually
specifying precisely the signature that GHC infers, but it's getting
rejected due to other rulings.
More information about the Libraries
mailing list