shithub: mc

ref: 2d65d0a17fc82b22730254ad1fa05c1913452c9e
dir: /libstd/error.myr/

View raw version
pkg std =
	type error(@a, @b)

	generic try	: (val : error(@a, byte[:]) -> void)
;;

type error(@a, @b) = union
	`Success	@a
	`Failure	@b
;;

generic try = {val
	/*
	match val
		`Success v:	-> v;;
		`Failure msg:	die(msg);;
	;;
	*/
}