wipplelang/wipple

`try` template

Closed this issue · 1 comments

Implement a try template that converts a value into a Result value, and exits the block if the result is Error:

Try : Container Success Failure => trait (Container -> Result Success Failure)
From-Error : Container Error => trait (Error -> Container)

try : x ~> when (Try x) {
  OK x -> x
  Error e -> end (From-Error e)
}

Duplicate of #118.