[Haskell-cafe] Shortening if-then-else

Arjan van IJzendoorn afie at cs.uu.nl
Tue Nov 22 12:48:49 EST 2005


> Is there a shorter way to write the if-then-else part below?
>        if (cmdType cmd) /= (CmdSitError Server)
>           then return $ Just seat_num
>           else return Nothing

return $ if cmdType cmd /= CmdSitError Serv
		then Just seat_num else Nothing

Arjan



More information about the Haskell-Cafe mailing list