summaryrefslogtreecommitdiff
path: root/lib/std/try.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-06-21 23:07:48 -0700
committerOri Bernstein <ori@eigenstate.org>2017-06-21 23:07:48 -0700
commit781e188ad6426398558638dfa0984699d64ef413 (patch)
tree4acf06313f2d36ba34246581ab552f42f45d6fc7 /lib/std/try.myr
parent2be6300162a3b32e4d82f71ed6772aa5feced897 (diff)
downloadmc-781e188ad6426398558638dfa0984699d64ef413.tar.gz
Move `canget()` to appropriate place.
Diffstat (limited to 'lib/std/try.myr')
-rw-r--r--lib/std/try.myr7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/std/try.myr b/lib/std/try.myr
index ade5a19..bb1f5fa 100644
--- a/lib/std/try.myr
+++ b/lib/std/try.myr
@@ -23,6 +23,13 @@ generic tryv = {v, d
;;
}
+generic canget = {o
+ match o
+ | `None: -> false
+ | `Some _: -> true
+ ;;
+}
+
generic get = {v
match v
| `Some x: -> x