unisonweb / unison

A friendly programming language from the future
https://unison-lang.org
Other
5.75k stars 269 forks source link

symboly argument names in lambdas lacking parens #5317

Open aryairani opened 4 weeks ago

aryairani commented 4 weeks ago
test.laws.associativity.doc : Doc
test.laws.associativity.doc =
  {{
  Checks the associativity property of a binary operation.

  `` associativity gen f `` checks that for all elements `x`, `y`, and `z`
  returned by `gen`, `f x (f y z)` is equal to `f (f x y) z`.

  For example, if `f` is {Nat.+}, then {{ docExample 4 do x (+) y z -> x + y + z
  }} is equal to {{ docExample 4 do (+) x y z -> x + y + z }}.
  }}

renders as

test.laws.associativity.doc : Doc
test.laws.associativity.doc =
  {{
  Checks the associativity property of a binary operation.

  `` associativity gen f `` checks that for all elements `x`, `y`, and `z`
  returned by `gen`, `f x (f y z)` is equal to `f (f x y) z`.

  For example, if `f` is {Nat.+}, then {{ docExample 4 do x + y z -> x + y + z
  }} is equal to {{ docExample 4 do + x y z -> x + y + z }}.
  }}

which doesn't parse.