Programming-Idioms

History of Idiom 78 > diff from v8 to v9

Edit summary for version 9 :

Version 8

2015-09-04, 12:39:26

Version 9

2015-09-05, 13:08:12

Idiom #78 "do while" loop

Execute a block once, then execute it again as long as boolean condition c is true.

Idiom #78 "do while" loop

Execute a block once, then execute it again as long as boolean condition c is true.

Imports

					
				
Code
dowhile :: (a -> Bool) -> IO a -> IO ()
dowhile c b = do a <- b ; if (c a) then dowhile c b else return ()

dowhile (/="END") getLine