shithub: mc

ref: 6b1a6216b40b804dd9c91c2bd54bee954776acaa
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("expected `Some @a, got `None\n")
	;;
}