Commit e35eb208 authored by Steffen Michels's avatar Steffen Michels

Merge branch 'replaceInList-fix' into 'master'

Fixed replaceInList when the predicate never matches

See merge request !111
parents c3c713f7 004aea21
Pipeline #9566 passed with stage
in 1 minute and 49 seconds
......@@ -108,7 +108,7 @@ where
(vs,ws,xs,ys,zs) = unzip5 vwxyzs
replaceInList :: !(a a -> Bool) !a ![a] -> [a]
replaceInList cond new [] = [new]
replaceInList _ _ [] = []
replaceInList cond new [x:xs]
| cond new x = [new : xs]
| otherwise = [x : replaceInList cond new xs]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment