diff --git a/src/Ema/App.hs b/src/Ema/App.hs
index 3aa58f9..0901311 100644
--- a/src/Ema/App.hs
+++ b/src/Ema/App.hs
@@ -48,7 +48,7 @@ runEmaPure render = do
-- exits, and vice-versa.
runEma ::
forall model route.
- (Ema model route, Show route) =>
+ (Ema route, Show route) =>
(model -> [route]) ->
-- | How to render a route, given the model
(CLI.Action -> model -> route -> LByteString) ->
@@ -65,7 +65,7 @@ runEma staticRoutes render runModel = do
-- Useful if you are handling CLI arguments yourself.
runEmaWithCli ::
forall model route.
- (Ema model route, Show route) =>
+ (Ema route, Show route) =>
Cli ->
(model -> [route]) ->
-- | How to render a route, given the model
@@ -91,7 +91,7 @@ runEmaWithCli cli staticRoutes render runModel = do
-- | Run Ema live dev server
runEmaWithCliInCwd ::
forall model route m.
- (MonadEma m, Ema model route, Show route) =>
+ (MonadEma m, Ema route, Show route) =>
-- | CLI arguments
CLI.Action ->
-- | Your site model type, as a @LVar@ in order to support modifications over
diff --git a/src/Ema/Class.hs b/src/Ema/Class.hs
index 105b215..74c436f 100644
--- a/src/Ema/Class.hs
+++ b/src/Ema/Class.hs
@@ -1,6 +1,5 @@
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DefaultSignatures #-}
-{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
@@ -17,7 +16,7 @@ type MonadEma m =
)
-- | Enrich a model to work with Ema
-class Ema model route | route -> model where
+class Ema route where
-- How to convert URLs to/from routes
encodeRoute :: route -> [Slug]
decodeRoute :: [Slug] -> Maybe route
@@ -29,7 +28,7 @@ class Ema model route | route -> model where
staticAssets Proxy = mempty
-- | The unit model is useful when using Ema in pure fashion (see @Ema.runEmaPure@) with a single route (index.html) only.
-instance Ema () () where
+instance Ema () where
encodeRoute () = []
decodeRoute = \case
[] -> Just ()
diff --git a/src/Ema/Example/Ex02_Basic.hs b/src/Ema/Example/Ex02_Basic.hs
index 3e78b24..df96bf5 100644
--- a/src/Ema/Example/Ex02_Basic.hs
+++ b/src/Ema/Example/Ex02_Basic.hs
@@ -25,7 +25,7 @@ data Route
data Model = Model Text
-instance Ema Model Route where
+instance Ema Route where
encodeRoute = \case
Index -> mempty
About -> one "about"
diff --git a/src/Ema/Example/Ex03_Clock.hs b/src/Ema/Example/Ex03_Clock.hs
index f5ca422..b63d416 100644
--- a/src/Ema/Example/Ex03_Clock.hs
+++ b/src/Ema/Example/Ex03_Clock.hs
@@ -25,7 +25,7 @@ data Route
| OnlyTime
deriving (Show, Enum, Bounded)
-instance Ema UTCTime Route where
+instance Ema Route where
encodeRoute = \case
Index -> mempty
OnlyTime -> one "time"
diff --git a/src/Ema/Generate.hs b/src/Ema/Generate.hs
index 2ea9fb0..96a0883 100644
--- a/src/Ema/Generate.hs
+++ b/src/Ema/Generate.hs
@@ -17,7 +17,7 @@ log = logWithoutLoc "Generate"
generate ::
forall model route m.
- (MonadEma m, Ema model route) =>
+ (MonadEma m, Ema route) =>
FilePath ->
model ->
[route] ->
@@ -28,7 +28,7 @@ generate dest model routes render = do
error $ "Destination does not exist: " <> toText dest
log LevelInfo $ "Writing " <> show (length routes) <> " routes"
forM_ routes $ \r -> do
- let fp = dest > routeFile @model r
+ let fp = dest > routeFile r
log LevelInfo $ toText $ "W " <> fp
let !s = render model r
liftIO $ do
diff --git a/src/Ema/Route.hs b/src/Ema/Route.hs
index 268aab3..24af4da 100644
--- a/src/Ema/Route.hs
+++ b/src/Ema/Route.hs
@@ -24,10 +24,10 @@ import Ema.Route.UrlStrategy
--
-- As the returned URL is relative, you will have to either make it absolute (by
-- prepending with `/`) or set the `
Once you fix your code this page will automatically update.