Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- class HasSubRoutes r where
- subRoutesIso :: forall r. (RGeneric r, HasSubRoutes r, ValidSubRoutes r (SubRoutes r)) => Iso' r (MultiRoute (SubRoutes r))
- type family GSubRoutes (name :: DatatypeName) (constrs :: [ConstructorName]) (xs :: [Type]) :: [Type] where ...
- gtoSubRoutes :: forall r subRoutes. (RGeneric r, ValidSubRoutes r subRoutes) => NS I (RCode r) -> MultiRoute subRoutes
- gfromSubRoutes :: forall r subRoutes. (RGeneric r, ValidSubRoutes r subRoutes) => MultiRoute subRoutes -> NS I (RCode r)
- 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))
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.
Instances
(GenericRouteOpts r opts, RGeneric r, ValidSubRoutes r (OptSubRoutes r opts)) => HasSubRoutes (GenericRoute r opts :: Type) Source # | |
Defined in Ema.Route.Generic type SubRoutes (GenericRoute r opts) :: [Type] Source # |
subRoutesIso :: forall r. (RGeneric r, HasSubRoutes r, ValidSubRoutes r (SubRoutes r)) => Iso' r (MultiRoute (SubRoutes r)) Source #
type family GSubRoutes (name :: DatatypeName) (constrs :: [ConstructorName]) (xs :: [Type]) :: [Type] where ... Source #
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 #