Logo

Programming-Idioms

History of Idiom 43 > diff from v25 to v26

Edit summary for version 26 by :
[Haskell] Just added spaces for more idiomatic formatting

Version 25

2015-12-30, 23:34:05

Version 26

2016-02-16, 18:06:23

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