@@ -17,7 +17,6 @@ import Prelude hiding (id, (.))
1717import Control.Category
1818-}
1919
20−import Control.Monad.Except
2120import Data.Text (Text)
2221import Data.Functor.Identity
2322import Data.Functor.Sum
@@ -41,16 +40,13 @@ backendRouteEncoder = handleEncoder (const (InL BackendRoute_Missing :/ ())) $
4140 pathComponentEncoder $ \case
4241 InL backendRoute -> case backendRoute of
4342 BackendRoute_Missing -> PathSegment "missing" $ unitEncoder mempty
44− InR obeliskRoute -> obeliskRouteSegment frontendRouteSegment obeliskRoute
43+ InR obeliskRoute -> obeliskRouteSegment obeliskRoute $ \case
44+ -- The encoder given to PathEnd determines how to parse query parameters,
45+ -- in this example, we have none, so we insist on it.
46+ FrontendRoute_Main -> PathEnd $ unitEncoder mempty
4547
46−frontendRouteSegment :: (Applicative check, MonadError Text parse)
47− => FrontendRoute a -> SegmentResult check parse a
48−frontendRouteSegment = \case
49− FrontendRoute_Main -> PathEnd $ unitEncoder mempty
50− -- The encoder given to PathEnd determines how to parse query parameters,
51− -- in this example, we have none, so we insist on it.
5248
5349concat <$> mapM deriveRouteComponent
5450 [ ''BackendRoute
5551 , ''FrontendRoute
56− ]
52+ ]