summaryrefslogtreecommitdiff
path: root/lib/std
diff options
context:
space:
mode:
authorLucas Gabriel Vuotto <lvuotto92@gmail.com>2017-06-21 22:21:18 -0300
committerOri Bernstein <ori@eigenstate.org>2017-06-21 23:06:29 -0700
commit2be6300162a3b32e4d82f71ed6772aa5feced897 (patch)
tree4be3978e44d5efcb694f8afdab43cb9200101516 /lib/std
parentfb7ccc88638087796d28ff288d757633c1ccb944 (diff)
downloadmc-2be6300162a3b32e4d82f71ed6772aa5feced897.tar.gz
Add function to test for something in std.option
Signed-off-by: Lucas Gabriel Vuotto <lvuotto92@gmail.com>
Diffstat (limited to 'lib/std')
-rw-r--r--lib/std/option.myr8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/std/option.myr b/lib/std/option.myr
index 4a36356..7d82245 100644
--- a/lib/std/option.myr
+++ b/lib/std/option.myr
@@ -3,5 +3,13 @@ pkg std =
`None
`Some @a
;;
+
+ generic canget : (o : option(@a) -> bool)
;;
+generic canget = {o
+ match o
+ | `None: -> false
+ | `Some _: -> true
+ ;;
+}