Logo

Programming-Idioms

History of Idiom 43 > diff from v17 to v18

Edit summary for version 18 by :

Version 17

2015-09-04, 17:47:35

Version 18

2015-09-04, 17:51:54

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 loop when no more searching is needed.