module Ema.Route.Class (
IsRoute (RouteModel, routePrism, routeUniverse),
) where
import Ema.Route.Prism (Prism_, toPrism_)
import Optics.Core (only)
import Prelude hiding (All, Generic)
class IsRoute r where
type RouteModel r :: Type
routePrism :: RouteModel r -> Prism_ FilePath r
routeUniverse :: RouteModel r -> [r]
instance IsRoute () where
type RouteModel () = ()
routePrism :: RouteModel () -> Prism_ FilePath ()
routePrism () = forall s a. Prism' s a -> Prism_ s a
toPrism_ forall a b. (a -> b) -> a -> b
$ forall a. Eq a => a -> Prism' a ()
only FilePath
"index.html"
routeUniverse :: RouteModel () -> [()]
routeUniverse () = forall x. One x => OneItem x -> x
one ()