shithub: mc

ref: ff88594df5c5df6fb8f227ab8e5df3529ba6e72f
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)))
}