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

Commit

Permalink
Parenthesize right-associative output
Browse files Browse the repository at this point in the history
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
Gabriel Gonzalez committed Sep 20, 2018
1 parent 4e565d6 commit 66f1ce7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion List/fold
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Natural/fold
Expand Up @@ -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)
Expand Down

0 comments on commit 66f1ce7

Please sign in to comment.