ema-generics-0.10.0.0: Static site generator library with hot reload
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ema.Route.Generic.SubRoute

Synopsis

Documentation

class HasSubRoutes r Source #

HasSubRoutes is a class of routes with an underlying MultiRoute (and MultiModel) representation.

The idea is that by deriving HasSubRoutes (and HasSubModels), we get IsRoute for free (based on MultiRoute).

TODO: Rename this class, or change the API.

Associated Types

type SubRoutes r :: [Type] Source #

The sub-routes in the r (for each constructor).

Instances

Instances details
(GenericRouteOpts r opts, RGeneric r, ValidSubRoutes r (OptSubRoutes r opts)) => HasSubRoutes (GenericRoute r opts :: Type) Source # 
Instance details

Defined in Ema.Route.Generic

Associated Types

type SubRoutes (GenericRoute r opts) :: [Type] Source #

type family GSubRoutes (name :: DatatypeName) (constrs :: [ConstructorName]) (xs :: [Type]) :: [Type] where ... Source #

Equations

GSubRoutes _ _ '[] = '[] 
GSubRoutes name (c ': cs) (() ': xs) = FileRoute (Constructor2RoutePath name c ".html") ': GSubRoutes name cs xs 
GSubRoutes name (c ': cs) (x ': xs) = FolderRoute (Constructor2RoutePath name c "") x ': GSubRoutes name cs xs 

gtoSubRoutes :: forall r subRoutes. (RGeneric r, ValidSubRoutes r subRoutes) => NS I (RCode r) -> MultiRoute subRoutes Source #

gfromSubRoutes :: forall r subRoutes. (RGeneric r, ValidSubRoutes r subRoutes) => MultiRoute subRoutes -> NS I (RCode r) Source #

type ValidSubRoutes r subRoutes = (SameShapeAs (RCode r) subRoutes, SameShapeAs subRoutes (RCode r), All Top (RCode r), All Top subRoutes, AllZipF Coercible (RCode r) subRoutes, AllZipF Coercible subRoutes (RCode r)) Source #

subRoutes are valid sub-routes of r