1 type Result<T, E> = 2 | Ok T 3 | Error E 4 5 def unwrap = case self of 6 Ok x -> x 7 Error _ -> fail "result is error" 8 9 def error = case self of 10 Error x -> x 11 else -> fail "result is ok" 12