> 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
> 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
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:* Anthony Clayden
> *Cc:* GHC users
> *Subject:* Re: InstanceSigs -- rati
;
>
> 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 *On
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 an argument
; 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
>
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` are neve
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
I can't help but feel InstanceSigs are either superfluous or upside-down.
It's this bit in the User Guide:
> The type signature in the instance declaration must be
> more polymorphic than (or the same as) the one in the class declaration,
> instantiated with the instance type.
Usually if you