Case sequence functions are defined by listing CASE(...) clauses in a BLOCK(...):
CASE(...)
BLOCK(...)
BLOCK( CASE(SOME(ID("x"))) ==> REF("x"), CASE(NONE) ==> LIT(0) )
This prints as:
{ case Some(x) => x case None => 0 }