From 264aeed33d0bd8772a16fc5461d3bfabcf4eb16a Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Fri, 18 May 2012 17:17:51 +0200 Subject: Use splitPath --- src/Hakyll/Core/Identifier.hs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/Hakyll/Core') diff --git a/src/Hakyll/Core/Identifier.hs b/src/Hakyll/Core/Identifier.hs index 3b67381..90f0eea 100644 --- a/src/Hakyll/Core/Identifier.hs +++ b/src/Hakyll/Core/Identifier.hs @@ -38,11 +38,11 @@ module Hakyll.Core.Identifier , setGroup ) where -import Control.Arrow (second) import Control.Applicative ((<$>), (<*>)) import Control.Monad (mplus) import Data.Monoid (Monoid, mempty, mappend) import Data.List (intercalate) +import System.FilePath (dropTrailingPathSeparator, splitPath) import Data.Binary (Binary, get, put) import GHC.Exts (IsString, fromString) @@ -83,9 +83,7 @@ parseIdentifier :: String -> Identifier a parseIdentifier = Identifier Nothing . intercalate "/" . filter (not . null) . split' where - split' [] = [[]] - split' str = let (pre, post) = second (drop 1) $ break (== '/') str - in pre : split' post + split' = map dropTrailingPathSeparator . splitPath -- | Convert an identifier to a relative 'FilePath' -- -- cgit v1.2.3