Programming-Idioms

History of Idiom 78 > diff from v20 to v21

Edit summary for version 21 :

Version 20

2015-09-05, 13:17:19

Version 21

2015-09-05, 13:19:00

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.

Code
doWhile c b = do a <- b
     if c a then doWhile c b else return a

doWhile (=="") getLine
Code
doWhile c b = do a <- b; if c a then doWhile c b else return a

doWhile (=="") getLine