Loops/Nested: Difference between revisions
Content added Content deleted
(added haskell: no explicit for loops) |
(→{{header|Haskell}}: introducing a break-inclusive function) |
||
Line 207:
<lang haskell>import Data.List
taskLLB k = map (breakIncl (==k)). breakIncl (k`elem`)</lang>
Example:
<lang haskell>mij :: [[Int]]
Line 214 ⟶ 215:
[2, 6, 17, 5, 14, 1, 9, 11, 18, 10, 13, 20, 8, 7, 4, 16, 15, 19, 3, 12]
*Main> mapM_ (mapM_ print) $ taskLLB 20 mij
2
6
17
[13,20]</lang>▼
5
14
1
9
11
18
10
13
=={{header|J}}==
|