mirror of
https://github.com/HigherOrderCO/Bend.git
synced 2024-09-11 03:45:29 +03:00
14 lines
195 B
Plaintext
14 lines
195 B
Plaintext
type Opt = (Some x) | None
|
|
|
|
Opt/map = @opt @f
|
|
match opt {
|
|
Opt/Some: (Opt/Some (f opt.x));
|
|
Opt/None: Opt/None
|
|
}
|
|
|
|
inc = @x (+ x 1)
|
|
|
|
main =
|
|
let opt = (Opt/Some 1);
|
|
(Opt/map opt inc)
|