@@ -6,6 +6,7 @@ module Text.Hakyll.Util
7import Data.Char
7import Data.Char
8import Data.List
8import Data.List
10-- | Trim a string (drop spaces and tabs at both sides).
11-- | Trim a string (drop spaces and tabs at both sides).
11trim :: String -> String
12trim :: String -> String
@@ -23,10 +24,5 @@ stripHTML str = let (beforeTag, rest) = break (== '<') str
23 tail' xs = tail xs
24 tail' xs = tail xs
25-- | Split a list at a certain element.
26-- | Split a list at a certain element.
26−split :: (Eq a) => a -> [a] -> [[a]]
27+split :: String -> String -> [String]
27−split element = unfoldr splitOnce
28+split pattern = splitRegex (mkRegex pattern)
28− where splitOnce l = let r = break (== element) l
29− in case r of ([], []) -> Nothing
30− (x, xs) -> if null xs
32− else Just (x, tail xs)