
22 Nov
2005
22 Nov
'05
4:20 p.m.
Is there a shorter way to write the if-then-else part below?
-- tryTakeSeat :: [Word8] -> Word8 -> ScriptState (Maybe Word8) tryTakeSeat _ _ = do ... if (cmdType cmd) /= (CmdSitError Server) then return $ Just seat_num else return Nothing --
tryTakeSeat _ _ = runMaybeT $ do ... guard $ cmdType cmd /= CmdSitError Server return seat_num -Yitz