fmease / lushui

The reference compiler of the Lushui programming language
Apache License 2.0
5 stars 0 forks source link

Change syntax of implicit parameters and arguments #63

Closed fmease closed 3 years ago

fmease commented 3 years ago

For reference, implicits today look like:

identity (,A: Type) (a: A): A = a
identity2: (,A: Type) -> A -> A = identity
identity3: (,A: Type) -> A -> A = \(,A) a => a
x: Nat = identity (,Nat) 0
y: List Int = identity (,List Int) [-1 0 1]
identity4 (,let A: Type) (a: A): A = a
z: Nat = identity (,A = Nat) 1

That does not look immensely aesthetically pleasing to my eyes. Change it to:

identity '(A: Type) (a: A): A = a
identity2: '(A: Type) -> A -> A = identity
identity3: '(A: Type) -> A -> A = \'A a => a
x: Nat = identity 'Nat 0
y: List Int = identity '(List Int) [-1 0 1]
identity4 '(let A: Type) (a: A): A = a
z: Nat = identity '(A = Nat) 1
fmease commented 3 years ago

Fixed in 6ca9cf18c8ab2f646bb3506488cc6d50ceaf25da.