Programming-Idioms

History of Idiom 42 > diff from v12 to v13

Edit summary for version 13 :

Version 12

2015-08-23, 00:03:48

Version 13

2015-09-05, 08:37:18

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] == [] ]
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-