Programming-Idioms

History of Idiom 78 > diff from v17 to v18

Edit summary for version 18 :

Version 17

2015-09-05, 13:14:37

Version 18

2015-09-05, 13:15:15

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