Logo

Programming-Idioms

History of Idiom 42 > diff from v13 to v14

Edit summary for version 14 by :

Version 13

2015-09-05, 08:37:18

Version 14

2015-09-05, 08:40:42

Idiom #42 Continue outer loop

Print each item v of list a which in not contained in list b.
For this, write an outer loop to iterate on a and an inner loop to iterate on b.

Idiom #42 Continue outer loop

Print each item v of list a which in not contained in list b.
For this, write an outer loop to iterate on a and an inner loop to iterate on b.

Code
sequence_ [ print v | v <- a, [ u | u <- b, u == v] == [] ]
Code
sequence_ [ print v | v <- a, [ u | u <- b, u == v] == [] ]
Comments bubble
a _\\ b abbreviates this task if you are not required to write your own printing iterations
Comments bubble
a _\\ b abbreviates this task if you are not required to write your own printing iterations
Doc URL
http://hackage.haskell.org/package/base-4.8.1.0/docs/Data-Function.html#v:-46-
Doc URL
http://hackage.haskell.org/package/base/docs/Data-List.html#v:-92--92-