shithub: mc

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