Logo

Programming-Idioms

History of Idiom 43 > diff from v19 to v20

Edit summary for version 20 by :

Version 19

2015-09-04, 17:52:27

Version 20

2015-09-04, 17:53:55

Idiom #43 Break outer loop

Look for a negative value v in 2D integer matrix m. Print it and stop searching.

Idiom #43 Break outer loop

Look for a negative value v in 2D integer matrix m. Print it and stop searching.

Code
(print.head.filter(<0).concat)m
Code
(print.head.filter(<0).concat)m
Comments bubble
Haskell's lazy evaluator takes care of breaking the loops when no more searching is needed.
Comments bubble
Haskell's lazy evaluator takes care of breaking all looping when no more searching is needed beyond the first found negative