Jump to content

Loops/Foreach: Difference between revisions

mNo edit summary
Line 491:
Function 'each' is defined in imperative module as:
<lang ela>each f (x::xs) = f x $ each f xs
each _ [] = ()</lang>
This also can be accomplished using 'map':
<lang ela>open console list
 
_ = map writen [1..10]</lang>
 
===Alternate Approach===
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.