Talk:If-then-else

From HaskellWiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Just to remark that

 liftM3 if' (return False) deleteHardDrive (return ())

executes deleteHardDrive, then decides to return the value of (return ()). --Conor McBride 14:41, 4 March 2008 (UTC)

bool-extras

I've just uploaded a package to Hackage that contains a similar function to the proposed if'.

It's called bool after the data type, similarly to maybe and either. Its arguments are in the exact opposite order of the if' function, since I think this makes partial application easier (everywhere I've used it, I either provide the first or the first two arguments).

http://hackage.haskell.org/cgi-bin/hackage-scripts/package/bool-extras --TomLokhorst 09:09, 13 May 2009 (UTC)