shithub: mc

ref: 405aec5462a0ecff66a03319f942fc3df2fa0d0b
dir: /libstd/try.myr/

View raw version
use "option.use"
use "fmt.use"

pkg std =
	generic try : (v : option(@a) -> @a)
;;

generic try = {v
	match v
	| `Some x:	-> x
	| `None:	fatal(1, "expected `Some @a, got `None\n")
	;;
}