Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Loops-Continue/Ela/loops-continue-1.ela
Normal file
13
Task/Loops-Continue/Ela/loops-continue-1.ela
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
open monad io
|
||||
|
||||
loop n =
|
||||
if n > 10 then do
|
||||
return ()
|
||||
else do
|
||||
putStr (show n)
|
||||
putStr f
|
||||
loop (n + 1)
|
||||
where f | n % 5 == 0 = "\r\n"
|
||||
| else = ", "
|
||||
|
||||
_ = loop 1 ::: IO
|
||||
11
Task/Loops-Continue/Ela/loops-continue-2.ela
Normal file
11
Task/Loops-Continue/Ela/loops-continue-2.ela
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
open monad io
|
||||
|
||||
loop [] = return ()
|
||||
loop (x::xs) = do
|
||||
putStr (show x)
|
||||
putStr f
|
||||
loop xs
|
||||
where f | x % 5 == 0 = "\r\n"
|
||||
| else = ", "
|
||||
|
||||
_ = loop [1..10] ::: IO
|
||||
Loading…
Add table
Add a link
Reference in a new issue