head-strict
head-strict
(theory)beforeZero :: [Int] -> [Int]beforeZero [] = []beforeZero (0:xs) = []beforeZero (x:xs) = x : beforeZero xs
which returns a list up to the first zero.
This pattern of evaluation is important because it is commonin functions which operate on a list of inputs.
See also tail-strict, hyperstrict.