shithub: mc

ref: 70f97fe9898b4852257a9268e6ea0592ee7e3a88
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 = {}\n", try(fail(123)))
}