1
1
mirror of https://github.com/anoma/juvix.git synced 2024-11-30 14:13:27 +03:00
juvix/tests/Compilation/positive/test076.juvix
Paul Cadman 7cfddcf915
Make Maybe a builtin inductive type (#2860)
This is required as the return type of the builtin
`anomaVerifyWithMessage` axiom.

Part of:
* https://github.com/anoma/juvix/issues/2850
2024-06-26 17:12:29 +01:00

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;