mirror of
https://github.com/HigherOrderCO/Bend.git
synced 2024-09-11 03:45:29 +03:00
18 lines
300 B
Plaintext
18 lines
300 B
Plaintext
# Mixed contents in a `do` block should still work.
|
|
Result/bind r nxt = match r {
|
|
Result/Ok: ((undefer nxt) r.val)
|
|
Result/Err: r
|
|
}
|
|
|
|
main = with Result {
|
|
let x = 1
|
|
let y = (Result/Ok x)
|
|
ask y = y
|
|
if (+ x y) {
|
|
ask w = (Result/Ok x)
|
|
(Result/Ok w)
|
|
} else {
|
|
(Result/Err 0)
|
|
}
|
|
}
|