[Haskell-cafe] Shortening if-then-else

Joel Reymont joelr1 at gmail.com
Tue Nov 22 12:42:12 EST 2005


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
--

	Thanks, Joel

--
http://wagerlabs.com/







More information about the Haskell-Cafe mailing list