
27 May
2019
27 May
'19
1:07 a.m.
Hi, I think `a || b && c` is more clear than ``` if a then True else if b then if c then True else False else False ``` And some languages, `pureComputing || (ioOperation && pure2)` involves IO only when pureComputing is False. So in Haskell, is it possible to get both benefits? ``` status <- ioOperation -- IO-ed anyway return $ pureComputing || (status && pure2) ``` ``` if pureComputing then return True else do status <- ioOperation if status then return pure2 else return False -- Looks ugly ```