packages feed

yesod-core-1.7.0.0: test/YesodCoreTest/FallthroughMatrix/FirstFoo.hs

{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ViewPatterns #-}

-- | The split-out nested-dispatch instance for @FirstFooR@, generated with the
-- DEFAULT route options — i.e. @fallthrough = False@. The @FooIndexR@\/@FooNeatR@
-- handlers live ONLY here, so the top module ("YesodCoreTest.FallthroughMatrix.Runtime") can
-- compile only by delegating to the @YesodDispatchNested FirstFooR@ instance
-- generated by this splice (it cannot inline handlers it can't see).
--
-- This module's flag is @False@, but a nested instance must still report a
-- path miss as 'Nothing' rather than baking a 404 into its own terminal
-- fallback — the fallthrough decision belongs to whichever module delegates
-- to it. An instance that 404s on its own would silently defeat the top
-- module's @fallthrough = True@ intent.
module YesodCoreTest.FallthroughMatrix.FirstFoo where

import Yesod.Core
import YesodCoreTest.FallthroughMatrix.Resources

mkYesodOpts (setFocusOnNestedRoute "FirstFooR" defaultOpts) "FMApp" fmResources

getFooIndexR :: HandlerFor FMApp String
getFooIndexR = pure "FooIndexR"

getFooNeatR :: HandlerFor FMApp String
getFooNeatR = pure "FooNeatR"