when debug (putStrLn "Debugging")will output the string Debugging if the Boolean value debug is True, and otherwise do nothing.
>>> putStr "pi:" >> when False (print 3.14159) pi:
when debug (putStrLn "Debugging")will output the string Debugging if the Boolean value debug is True, and otherwise do nothing.
\b m -> when b m == mfilter (const b) (m::Maybe Ordering)
\b m -> when b m == mfilter (const b) (m::String)
d1 $ when (elem '4' . show) (striate 4) $ sound "hh hc"The above will only apply striate 4 to the pattern if the current cycle number contains the number 4. So the fourth cycle will be striated and the fourteenth and so on. Expect lots of striates after cycle number 399.
RS.get (RS.when b r) === (if RB.get b then RS.get r else S.empty)
>>> split (whenElt (<0)) [2,4,-3,6,-9,1 :: Int] [[2,4],[-3],[6],[-9],[1]]