Case Sequence Functions 

Case sequence functions are defined by listing CASE(...) clauses in a BLOCK(...):

BLOCK(
  CASE(SOME(ID("x"))) ==> REF("x"),
  CASE(NONE) ==> LIT(0)
)

This prints as:

{
  case Some(x) => x
  case None => 0
}