adapt to GHC-7.10's foldable/traversable changes (#239)

This commit is contained in:
Simon Michael 2015-03-27 15:43:28 -07:00
parent e60eb71467
commit 4538745005

View File

@ -126,7 +126,7 @@ replaceBackReference _ s = error' $ "replaceBackReference called on non-numeric-
replaceAllBy :: Regex -> (String -> String) -> String -> String replaceAllBy :: Regex -> (String -> String) -> String -> String
replaceAllBy re f s = start end replaceAllBy re f s = start end
where where
(_, end, start) = foldl' go (0, s, id) $ getAllMatches $ match re s (_, end, start) = foldl' go (0, s, id) $ (getAllMatches $ match re s :: [(Int, Int)])
go (ind,read,write) (off,len) = go (ind,read,write) (off,len) =
let (skip, start) = splitAt (off - ind) read let (skip, start) = splitAt (off - ind) read
(matched, remaining) = splitAt len start (matched, remaining) = splitAt len start