Skip to content

Commit

Permalink
replace deprecated Optional/fold using Prelude
Browse files Browse the repository at this point in the history
  • Loading branch information
mschwaig committed Jul 22, 2021
1 parent 2b7ea59 commit b20dba9
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion render/Attributes.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ let types = ../types.dhall
let renderAttribute =
λ(name : Text)
λ(x : Optional Bool)
Optional/fold
Prelude.Optional.fold
Bool
x
(List Text)
Expand Down
4 changes: 2 additions & 2 deletions render/Config.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ let renderOptional =
λ(a : Type)
λ(f : a Text)
λ(optional : Optional a)
Optional/fold a optional Text (λ(x : a) renderOptions (f x)) ""
Prelude.Optional.fold a optional Text (λ(x : a) renderOptions (f x)) ""

let renderNamedOptional =
λ(a : Type)
Expand Down Expand Up @@ -65,7 +65,7 @@ let renderOptionalEnabled =
let renderOptionalTopLevel =
λ(name : Text)
λ(x : Optional Text)
Optional/fold
Prelude.Optional.fold
Text
x
Text
Expand Down
2 changes: 1 addition & 1 deletion render/Disclose.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let renderDisclosure = ./Disclosure.dhall
let renderOptionalDisclosure =
λ(suffix : Text)
λ(x : Optional types.Disclosure)
Optional/fold
Prelude.Optional.fold
types.Disclosure
x
(List Text)
Expand Down
5 changes: 3 additions & 2 deletions render/Hilite.dhall
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
let types = ../types.dhall
let Prelude = ../Prelude.dhall

in λ(a : Type)
λ(renderTrigger : a Text)
λ(hilite : types.Hilite a)
let trigger =
Optional/fold
Prelude.Optional.fold
a
hilite.trigger
Text
(λ(trigger : a) "/${renderTrigger trigger}")
""

let attributes =
Optional/fold
Prelude.Optional.fold
types.Attributes.Type
hilite.attributes
Text
Expand Down
3 changes: 2 additions & 1 deletion render/MenuColor.dhall
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
let types = ../types.dhall
let Prelude = ../Prelude.dhall

in λ(x : types.MenuColor)
let attributes = ./Attributes.dhall x.attributes

let suffix =
Optional/fold
Prelude.Optional.fold
types.Color
x.color
Text
Expand Down
2 changes: 1 addition & 1 deletion render/ParanoidConfirmation.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ let types = ../types.dhall
let renderConfirmation =
λ(name : Text)
λ(o : Optional Bool)
Optional/fold
Prelude.Optional.fold
Bool
o
(List Text)
Expand Down
6 changes: 3 additions & 3 deletions render/Scores.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ let types = ../types.dhall

in λ(x : types.Scores.Type)
let own =
Optional/fold
Prelude.Optional.fold
Bool
x.own
(List Text)
(λ(b : Bool) [ "${./Bool.dhall b}o" ])
([] : List Text)

let around =
Optional/fold
Prelude.Optional.fold
Natural
x.around
(List Text)
(λ(n : Natural) [ "${Natural/show n}a" ])
([] : List Text)

let top =
Optional/fold
Prelude.Optional.fold
Natural
x.top
(List Text)
Expand Down

0 comments on commit b20dba9

Please sign in to comment.