def fromJust(val): return match(val, ('Just(j)', lambda j: j))
def maybe_(no, val): return match(val, ('Just(j)', lambda j: j), ('Nothing()', lambda: no))
def isNothing(m): return match(m, ('Nothing()', lambda: True), ('_', lambda: False))
def isJust(m): return match(m, ('Just(_)', lambda: True), ('_', lambda: False))
def snd(t): return match(t, ('(_, s)', identity))
def fst(t): return match(t, ('(f, _)', identity))