summaryrefslogtreecommitdiff
path: root/src/Hakyll/Core/Routes.hs
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2011-04-06 14:05:29 +0200
committerJasper Van der Jeugt <jaspervdj@gmail.com>2011-04-06 14:05:29 +0200
commit80596b1f56b7d6f2d4ff64d566ae845b7c7a01f6 (patch)
treebf6b02d68833821f7b57f40edc8dd8a60543fa09 /src/Hakyll/Core/Routes.hs
parentc3dbb0ca77f65461e60cb801b867fff18afda2be (diff)
parentce444a426ac037c2b32568d8e6325aa5762bf913 (diff)
downloadhakyll-80596b1f56b7d6f2d4ff64d566ae845b7c7a01f6.tar.gz
Merge branch 'master' into dependency-analyzer
Diffstat (limited to 'src/Hakyll/Core/Routes.hs')
-rw-r--r--src/Hakyll/Core/Routes.hs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/Hakyll/Core/Routes.hs b/src/Hakyll/Core/Routes.hs
index fcab28d..abbd0a7 100644
--- a/src/Hakyll/Core/Routes.hs
+++ b/src/Hakyll/Core/Routes.hs
@@ -30,7 +30,7 @@ module Hakyll.Core.Routes
, runRoutes
, idRoute
, setExtension
- , ifMatch
+ , matchRoute
, customRoute
, gsubRoute
, composeRoutes
@@ -85,15 +85,15 @@ setExtension :: String -> Routes
setExtension extension = Routes $ fmap (`replaceExtension` extension)
. unRoutes idRoute
--- | Modify a route: apply the route if the identifier matches the given
--- pattern, fail otherwise.
+-- | Apply the route if the identifier matches the given pattern, fail
+-- otherwise
--
-ifMatch :: Pattern -> Routes -> Routes
-ifMatch pattern (Routes route) = Routes $ \id' ->
- if doesMatch pattern id' then route id'
- else Nothing
+matchRoute :: Pattern -> Routes -> Routes
+matchRoute pattern (Routes route) = Routes $ \id' ->
+ if matches pattern id' then route id' else Nothing
--- | Create a custom route. This should almost always be used with 'ifMatch'.
+-- | Create a custom route. This should almost always be used with
+-- 'matchRoute'
--
customRoute :: (Identifier -> FilePath) -> Routes
customRoute f = Routes $ Just . f