Added contains functions in List and Option. Fixed one type error catch

This commit is contained in:
radrow
2020-08-26 11:56:18 +02:00
parent ed5447e430
commit 7e32ef57c2
4 changed files with 32 additions and 7 deletions
+4
View File
@@ -26,6 +26,10 @@ namespace Option =
None => abort("Forced None value")
Some(x) => x
function contains(e : 'a, o : option('a)) = switch(o)
None => false
Some(x) => x == e
function on_elem(o : option('a), f : 'a => unit) : unit = match((), f, o)
function map(f : 'a => 'b, o : option('a)) : option('b) = switch(o)