71104 / lambda

The Lambda Programming Language
MIT License
19 stars 2 forks source link

Ambiguous syntax #76

Closed 71104 closed 8 years ago

71104 commented 8 years ago

The following snippet:

fn x: int -> x

yields a syntax error because the parser interprets the arrow as part of the type (x would be a function taking an int and returning something wrong).

71104 commented 8 years ago

With be3ded9 the syntax for lambda types uses fat arrows rather than arrows. The previous becomes valid, while the following:

fn x: int => int -> x

describes a function taking a parameter x whose type is a function taking an int and returning an int.

The fat arrow can no longer be used to abstract type variables. This is not necessary for now thanks to Hindley-Milner.