-- pattern matching type optbool { Just : Bool -> optbool; Nothing : optbool; }; def intToBool : Int -> Bool := \(x : Int) if x = 0 then false else true; def boolToInt : Bool -> Int := \(x : Bool) if x then 1 else 0; \(x : Int) \(y : Int) (\(x : Bool) \(o : optbool) { boolToInt (case o of { Just b := if x then true else b; Nothing := false }) }) (intToBool x) (Just (intToBool y))