packages feed

dhall-1.3.0: Prelude/Optional/build

{-
`build` is the inverse of `fold`

Examples:

```
./build
Integer
(   λ(optional : Type)
→   λ(just : Integer → optional)
→   λ(nothing : optional)
→   just 1
)
= [1] : Optional Integer

./build
Integer
(   λ(optional : Type)
→   λ(just : Integer → optional)
→   λ(nothing : optional)
→   nothing
)
= [] : Optional Integer
```
-}
let build
    :   ∀(a : Type)
    →   (   ∀(optional : Type)
        →   ∀(just : a → optional)
        →   ∀(nothing : optional)
        →   optional
        )
    →   Optional a
    =   Optional/build

in  build