Globally replace text in several files: Difference between revisions

m
(→‎{{header|Haskell}}: Simplifed type of recursion in replace, preferred guards to if then else, applied Hlint)
Line 674:
replace a b = go
where
w = length a
go [] = []
go xxxxs@(x : xs)
| a `isPrefixOf` xxxxs = b <> go (drop (length a)w xxxxs)
| otherwise = x : go xs</lang>
'''Example:'''
9,655

edits