diff options
author | Jasper Van der Jeugt <m@jaspervdj.be> | 2012-11-13 13:13:17 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <m@jaspervdj.be> | 2012-11-13 13:13:17 +0100 |
commit | 89272dd97f805695b3d03f9a9fb05d22f30d8a7d (patch) | |
tree | 3ead5048b380454f42c84962513e53078506054c /src/Hakyll/Core/Routes.hs | |
parent | 760b4344377c81922ce5ab4ba05a41f88f45165d (diff) | |
download | hakyll-89272dd97f805695b3d03f9a9fb05d22f30d8a7d.tar.gz |
Simplify stuff
Diffstat (limited to 'src/Hakyll/Core/Routes.hs')
-rw-r--r-- | src/Hakyll/Core/Routes.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Hakyll/Core/Routes.hs b/src/Hakyll/Core/Routes.hs index 63e32e7..27e03b1 100644 --- a/src/Hakyll/Core/Routes.hs +++ b/src/Hakyll/Core/Routes.hs @@ -53,7 +53,7 @@ import Hakyll.Core.Util.String -------------------------------------------------------------------------------- -- | Type used for a route -newtype Routes = Routes {unRoutes :: forall a. Identifier a -> Maybe FilePath} +newtype Routes = Routes {unRoutes :: Identifier -> Maybe FilePath} -------------------------------------------------------------------------------- @@ -64,7 +64,7 @@ instance Monoid Routes where -------------------------------------------------------------------------------- -- | Apply a route to an identifier -runRoutes :: Routes -> Identifier a -> Maybe FilePath +runRoutes :: Routes -> Identifier -> Maybe FilePath runRoutes = unRoutes @@ -101,16 +101,16 @@ setExtension extension = Routes $ -------------------------------------------------------------------------------- -- | Apply the route if the identifier matches the given pattern, fail -- otherwise -matchRoute :: Pattern a -> Routes -> Routes +matchRoute :: Pattern -> Routes -> Routes matchRoute pattern (Routes route) = Routes $ \id' -> - if matches pattern (castIdentifier id') then route id' else Nothing + if matches pattern id' then route id' else Nothing -------------------------------------------------------------------------------- -- | Create a custom route. This should almost always be used with -- 'matchRoute' -customRoute :: (Identifier a -> FilePath) -> Routes -customRoute f = Routes $ Just . f . castIdentifier +customRoute :: (Identifier -> FilePath) -> Routes +customRoute f = Routes $ Just . f -------------------------------------------------------------------------------- |