Permalink
Browse files

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
  • Loading branch information...
Gabriel439 committed Sep 20, 2018
1 parent 4e565d6 commit a22da69657b9316a3c51ba0bf80c9d4024db3fce
Showing with 2 additions and 2 deletions.
  1. +1 −1 List/fold
  2. +1 −1 Natural/fold
View
@@ -22,7 +22,7 @@ Examples:
Natural
(λ(x : Natural) → λ(y : Natural) → x + y)
nil
= λ(nil : Natural) → 2 + 3 + 5 + nil
= λ(nil : Natural) → 2 + (3 + (5 + nil))
λ(list : Type)
→ λ(cons : Natural → list → list)
View
@@ -10,7 +10,7 @@ Examples:
./fold 3 Natural (λ(x : Natural) → 5 * x) 1 = 125
λ(zero : Natural) → ./fold 3 Natural (λ(x : Natural) → 5 * x) zero
= λ(zero : Natural) → 5 * 5 * 5 * zero
= λ(zero : Natural) → 5 * (5 * (5 * zero))
λ(natural : Type)
→ λ(succ : natural → natural)

0 comments on commit a22da69

Please sign in to comment.