From 89272dd97f805695b3d03f9a9fb05d22f30d8a7d Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Tue, 13 Nov 2012 13:13:17 +0100 Subject: Simplify stuff --- src/Hakyll/Core/Routes.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Hakyll/Core/Routes.hs') 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 -------------------------------------------------------------------------------- -- cgit v1.2.3