mirror of
https://github.com/anoma/juvix.git
synced 2024-11-30 14:13:27 +03:00
7cfddcf915
This is required as the return type of the builtin `anomaVerifyWithMessage` axiom. Part of: * https://github.com/anoma/juvix/issues/2850
16 lines
268 B
Plaintext
16 lines
268 B
Plaintext
-- builtin maybe
|
|
module test076;
|
|
|
|
import Juvix.Builtin.V1.Nat open;
|
|
|
|
builtin maybe
|
|
type Maybe A :=
|
|
| nothing
|
|
| just A;
|
|
|
|
fromMaybe {A} (default : A) : Maybe A -> A
|
|
| nothing := default
|
|
| (just a) := a;
|
|
|
|
main : Nat := fromMaybe 0 (just 1) + fromMaybe 5 nothing;
|