Logo

Programming-Idioms

History of Idiom 43 > diff from v20 to v21

Edit summary for version 21 by :

Version 20

2015-09-04, 17:53:55

Version 21

2015-09-04, 17:56:17

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 all looping when no more searching is needed beyond the first found negative
Comments bubble
Haskell's lazy evaluator takes care of breaking all looping when no more searching is needed beyond the first found negative