shithub: mc

ref: fe0bcf756016bd8cad54c1af77f054b94fc8d11b
dir: /test/genericchain.myr/

View raw version
use std

generic fail = {val : @a
	-> `std.Some val
}

generic try = {opt : std.option(@b)
	match opt
	| `std.Some v:	-> v
	| `std.None:	std.die("Badness\n")
	;;
}

const main = {
	std.put("val = %i\n", try(fail(123)))
}