To the best of my knowledge, `InstanceSigs` are never strictly necessary.
They can, however, be useful for at least four purposes:
1. To provide a compiler-checked reminder of the type.
2. To bind type variables with `ScopedTypeVariables`.
3. To generalize the type so you can use polymorphic recur
plain this better,
that would be great.
Simon
From: Glasgow-haskell-users On
Behalf Of David Feuer
Sent: 08 August 2021 09:37
To: Anthony Clayden
Cc: GHC users
Subject: Re: InstanceSigs -- rationale for the "must be more polymorphic than"
To the best of my knowledge, `InstanceSigs
etter, that would be great.
>
>
>
> Simon
>
>
>
> *From:* Glasgow-haskell-users *On
> Behalf Of *David Feuer
> *Sent:* 08 August 2021 09:37
> *To:* Anthony Clayden
> *Cc:* GHC users
> *Subject:* Re: InstanceSigs -- rationale for the "must be more
>
Feuer
Sent: 10 August 2021 12:01
To: Simon Peyton Jones
Cc: Anthony Clayden ; GHC users
Subject: Re: InstanceSigs -- rationale for the "must be more polymorphic than"
Simon, there are times when a function has to be generalized to be made
polymorphic recursive. Perhaps the method takes a
;
>
>
> All in all, no big deal. Instance signature are a convenience, never a
> necessity.
>
>
>
> If you would like to offer a patch for the user manual to explain this
> better, that would be great.
>
>
>
> Simon
>
>
>
> *From:* Glasgow-haskell-users
the method's private types/vars? The actual type inferred
would be the mgu of the InstanceSig given with the substitution from the
instance head & constraints.
>
>
> *From:* Glasgow-haskell-users *On
> Behalf Of *David Feuer
> *Sent:* 08 August 2021 09:37
> *To:* Anth
> If you would like to offer a patch for the user manual to explain this
better, that would be great.
Thank you Simon for the invitation.
On further investigation https://gitlab.haskell.org/ghc/ghc/-/issues/20357,
what I'd like the user manual to say is:
"InstanceSigs is a mis-feature. Don't use
> On 18 Sep 2021, at 04:29, Anthony Clayden wrote:
> "InstanceSigs is a mis-feature. Don't use it. It is less confusing to just
> give no signature at all. If you really, really want to bind tyvars, use
> PatternSignatures."
I would strongly disagree with this statement. I think instance signa