[ghc-steering-committee] Discussion on #155 Type Variable in Labmdas
Eric Seidel
eric at seidel.io
Wed Mar 27 01:47:41 UTC 2019
On Tue, Mar 26, 2019, at 13:17, Iavor Diatchki wrote:
> My concern is that the notation certainly suggests that you are binding
> types with the @ syntax, but in really it is still the type signature
> that guides the binding of the variables and the @ parameters just
> duplicate the information from the type signature.
But you are binding types with the @ syntax. The proposal gives a number of examples where the @-bound type variable is bound by a different name (or not at all) in the type signature. Many are contrived, to demonstrate where the binders are allowed, but the higher-rank and proxy-eliding examples look compelling to me.
We also already allow repeated value binders in Haskell. When I write a function in equational style, I have to rebind each argument in each alternate equation. Sometimes this is noisy and I'll prefer a single equation with an explicit `case`. But for functions where the body is sizable, I find the repeated binders to be quite helpful because the scopes are smaller. I can easily see the same benefit applying to type binders. Ultimately, I think this comes down to a matter of style, and I favor letting Haskell programmers pick the style that works best for them.
Eric
More information about the ghc-steering-committee
mailing list