shithub: mc

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