[ghc-steering-committee] Discussion on #155 Type Variable in Labmdas

Iavor Diatchki iavor.diatchki at gmail.com
Tue Feb 19 18:28:36 UTC 2019


Hello,

let's get the discussion going about proposal #155 (
https://github.com/goldfirere/ghc-proposals/blob/type-lambda/proposals/0000-type-lambda.rst
).

Summary:
the idea is pretty simple:  allow functions to name their type arguments
explicitly, so that they can be used in type signatures within the
function's definition.   The notation for a type argument is `@a`, and such
type arguments can be used only when functions have an explicit type
signature (technically, when GHC is doing "checking" rather then
"inference").

This proposal provides an alternative to "ScopedTypeVariables" to refer to
type parameters, which I think is a step in the right direction, as using
the `forall` to introduce type variables always felt a bit hacky to me
(now, there's a technical argument :)

I am a bit concerned with the notation though:  in other places where we
use `@a`, (e.g., #126 type application in patterns, and TypeApplications)
the `a` is a type, while in this use it must be a variable.   I wonder if
this punning might be confusing.   I don't really have an alternative
suggestion though.

What does everyone else thing?

-Iavor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-steering-committee/attachments/20190219/9b3bfb06/attachment.html>


More information about the ghc-steering-committee mailing list