shithub: mc

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