shithub: mc

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