shithub: mc

ref: 7d590b64d3ad57239c8835b2fd1a0d2db2b2981a
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")
	;;
}