-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Core Modules of Haskell Admin -- -- Please see the README on GitHub at -- https://github.com/martin-bednar/haskell-admin#readme @package haskell-admin-core @version 1.0.0.0 module Admin.Components.Component data Component (name :: Symbol) api Component :: Server api -> Version -> Component (name :: Symbol) api [server] :: Component (name :: Symbol) api -> Server api [version] :: Component (name :: Symbol) api -> Version module Admin.Components.ComponentDescription data ComponentDescription ComponentDescription :: String -> Version -> ComponentDescription [componentName] :: ComponentDescription -> String [componentVersion] :: ComponentDescription -> Version instance Data.Aeson.Types.FromJSON.FromJSON Admin.Components.ComponentDescription.ComponentDescription instance Data.Aeson.Types.ToJSON.ToJSON Admin.Components.ComponentDescription.ComponentDescription instance GHC.Generics.Generic Admin.Components.ComponentDescription.ComponentDescription instance GHC.Classes.Eq Admin.Components.ComponentDescription.ComponentDescription instance GHC.Show.Show Admin.Components.ComponentDescription.ComponentDescription instance GHC.Read.Read Admin.Components.ComponentDescription.ComponentDescription module Admin.API -- | The type-level definition of the Haskell Admin API with server -- components as a parameter type AdminAPI components = Root :<|> "components" :> ComponentsAPI components type ComponentsAPI inner = Get '[JSON] [ComponentDescription] :<|> inner module Admin.Components.Internal.TypeLevel type family NamesOf (xs :: [*]) type family NameOf (x :: *) type family ApisOf (xs :: [*]) type family ApiOf (x :: *) class ManySymbolVal (xs :: [Symbol]) manySymbolVal :: ManySymbolVal xs => proxy xs -> [String] instance Admin.Components.Internal.TypeLevel.ManySymbolVal '[] instance (GHC.TypeLits.KnownSymbol a, Admin.Components.Internal.TypeLevel.ManySymbolVal as) => Admin.Components.Internal.TypeLevel.ManySymbolVal (a : as) module Admin.Components.ComponentList data ComponentList (names :: [Symbol]) apis ComponentList :: Server apis -> [Version] -> ComponentList (names :: [Symbol]) apis [serveAll] :: ComponentList (names :: [Symbol]) apis -> Server apis [versions] :: ComponentList (names :: [Symbol]) apis -> [Version] namesOf :: forall names apis. ManySymbolVal names => ComponentList names apis -> [String] descriptionsOf :: forall names apis. ManySymbolVal names => ComponentList names apis -> [ComponentDescription] empty :: ComponentList '[] EmptyAPI module Admin.Components.ComponentsClass -- | Compose Components -- -- This function combines a Component with another -- Component, or with a ComponentList, producing a -- ComponentList. -- -- It collects the names of the components, and keeps the expected API -- structure. -- -- Usage: >>> componentA with componentB with -- componentC with :: Components a names apis => Component name api -> a -> ComponentList (name : names) ((name :> api) :<|> apis) infixr 9 `with` class (ToServantAPI names apis) => Components a (names :: [Symbol]) apis | a -> names apis serveAll' :: Components a names apis => a -> Server apis describe :: Components a names apis => a -> [ComponentDescription] instance (GHC.TypeLits.KnownSymbol name, Servant.Server.Internal.HasServer api '[]) => Admin.Components.ComponentsClass.Components (Admin.Components.Component.Component name api) '[name] (name Servant.API.Sub.:> api) instance Admin.Components.ComponentsClass.ToServantAPI names apis => Admin.Components.ComponentsClass.Components (Admin.Components.ComponentList.ComponentList names apis) names apis module Admin.Components module Admin.Component.EmptyComponent emptyComponent :: Component "empty" EmptyAPI module Admin.Server.Middlewares -- | Middlewares used in Haskell Admin middlewares :: [ByteString] -> Middleware module Admin.Server adminApp :: Components a names api => a -> [ByteString] -> Application serveAdmin :: Components a names api => a -> Server (AdminAPI api)