Skip to content
This repository was archived by the owner on Dec 30, 2018. It is now read-only.

Commit a22da69

Browse files
authored
Parenthesize right-associative output (#11)
This is related to dhall-lang/dhall-lang#233 Specifically, `List/fold` and `Natural/fold` produce right-associated operators, so the output must now be explicitly parenthesized since the default associativity is specified to be left-associativity
1 parent 4e565d6 commit a22da69

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

List/fold

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Examples:
2222
Natural
2323
(λ(x : Natural) → λ(y : Natural) → x + y)
2424
nil
25-
= λ(nil : Natural) → 2 + 3 + 5 + nil
25+
= λ(nil : Natural) → 2 + (3 + (5 + nil))
2626

2727
λ(list : Type)
2828
→ λ(cons : Natural → list → list)

Natural/fold

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Examples:
1010
./fold 3 Natural (λ(x : Natural) → 5 * x) 1 = 125
1111

1212
λ(zero : Natural) → ./fold 3 Natural (λ(x : Natural) → 5 * x) zero
13-
= λ(zero : Natural) → 5 * 5 * 5 * zero
13+
= λ(zero : Natural) → 5 * (5 * (5 * zero))
1414

1515
λ(natural : Type)
1616
→ λ(succ : natural → natural)

0 commit comments

Comments
 (0)