shithub: mc

Download patch

ref: 2be6300162a3b32e4d82f71ed6772aa5feced897
parent: fb7ccc88638087796d28ff288d757633c1ccb944
author: Lucas Gabriel Vuotto <lvuotto92@gmail.com>
date: Wed Jun 21 18:21:18 EDT 2017

Add function to test for something in std.option

Signed-off-by: Lucas Gabriel Vuotto <lvuotto92@gmail.com>

--- a/lib/std/option.myr
+++ b/lib/std/option.myr
@@ -3,5 +3,13 @@
 		`None
 		`Some @a
 	;;
+
+	generic canget	: (o : option(@a) -> bool)
 ;;
 
+generic canget = {o
+	match o
+	| `None: -> false
+	| `Some _: -> true
+	;;
+}