clckwrks-0.24.0.15: A secure, reliable content management system (CMS) and blogging platform

Safe HaskellNone
LanguageHaskell2010

Clckwrks.Monad

Contents

Synopsis

Documentation

type Clck url = ClckT url (ServerPartT IO) Source #

type ClckPlugins = Plugins Theme (ClckT ClckURL (ServerPartT IO) Response) (ClckT ClckURL IO ()) ClckwrksConfig ClckPluginsSt Source #

ClckPlugins

newtype Plugins theme m hook config st

newtype ClckT url m a Source #

Constructors

ClckT 

Fields

Instances
Monad m => MonadState ClckState (ClckT url m) Source # 
Instance details

Defined in Clckwrks.Monad

Methods

get :: ClckT url m ClckState #

put :: ClckState -> ClckT url m () #

state :: (ClckState -> (a, ClckState)) -> ClckT url m a #

FilterMonad r m => FilterMonad r (ClckT url m) Source # 
Instance details

Defined in Clckwrks.Monad

Methods

setFilter :: (r -> r) -> ClckT url m () #

composeFilter :: (r -> r) -> ClckT url m () #

getFilter :: ClckT url m b -> ClckT url m (b, r -> r) #

WebMonad r m => WebMonad r (ClckT url m) Source # 
Instance details

Defined in Clckwrks.Monad

Methods

finishWith :: r -> ClckT url m b #

MonadTrans (ClckT url) Source # 
Instance details

Defined in Clckwrks.Monad

Methods

lift :: Monad m => m a -> ClckT url m a #

IsName n Text => EmbedAsAttr (Clck AdminURL) (Attr n AdminURL) Source # 
Instance details

Defined in Clckwrks.Monad

IsName n Text => EmbedAsAttr (Clck ClckURL) (Attr n ClckURL) Source # 
Instance details

Defined in Clckwrks.Monad

Monad m => Monad (ClckT url m) Source # 
Instance details

Defined in Clckwrks.Monad

Methods

(>>=) :: ClckT url m a -> (a -> ClckT url m b) -> ClckT url m b #

(>>) :: ClckT url m a -> ClckT url m b -> ClckT url m b #

return :: a -> ClckT url m a #

fail :: String -> ClckT url m a #

Functor m => Functor (ClckT url m) Source # 
Instance details

Defined in Clckwrks.Monad

Methods

fmap :: (a -> b) -> ClckT url m a -> ClckT url m b #

(<$) :: a -> ClckT url m b -> ClckT url m a #

Monad m => Applicative (ClckT url m) Source # 
Instance details

Defined in Clckwrks.Monad

Methods

pure :: a -> ClckT url m a #

(<*>) :: ClckT url m (a -> b) -> ClckT url m a -> ClckT url m b #

liftA2 :: (a -> b -> c) -> ClckT url m a -> ClckT url m b -> ClckT url m c #

(*>) :: ClckT url m a -> ClckT url m b -> ClckT url m b #

(<*) :: ClckT url m a -> ClckT url m b -> ClckT url m a #

MonadPlus m => Alternative (ClckT url m) Source # 
Instance details

Defined in Clckwrks.Monad

Methods

empty :: ClckT url m a #

(<|>) :: ClckT url m a -> ClckT url m a -> ClckT url m a #

some :: ClckT url m a -> ClckT url m [a] #

many :: ClckT url m a -> ClckT url m [a] #

MonadPlus m => MonadPlus (ClckT url m) Source # 
Instance details

Defined in Clckwrks.Monad

Methods

mzero :: ClckT url m a #

mplus :: ClckT url m a -> ClckT url m a -> ClckT url m a #

MonadIO m => MonadIO (ClckT url m) Source # 
Instance details

Defined in Clckwrks.Monad

Methods

liftIO :: IO a -> ClckT url m a #

Happstack m => Happstack (ClckT url m) Source # 
Instance details

Defined in Clckwrks.Monad

(Monad m, HasRqData m) => HasRqData (ClckT url m) Source # 
Instance details

Defined in Clckwrks.Monad

Methods

askRqEnv :: ClckT url m RqEnv #

localRqEnv :: (RqEnv -> RqEnv) -> ClckT url m a -> ClckT url m a #

rqDataError :: Errors String -> ClckT url m a #

ServerMonad m => ServerMonad (ClckT url m) Source # 
Instance details

Defined in Clckwrks.Monad

Methods

askRq :: ClckT url m Request #

localRq :: (Request -> Request) -> ClckT url m a -> ClckT url m a #

(Functor m, Monad m) => XMLGen (ClckT url m) Source # 
Instance details

Defined in Clckwrks.Monad

Associated Types

type XMLType (ClckT url m) :: Type #

type StringType (ClckT url m) :: Type #

data ChildType (ClckT url m) :: Type #

data AttributeType (ClckT url m) :: Type #

Methods

genElement :: Name (StringType (ClckT url m)) -> [XMLGenT (ClckT url m) [AttributeType (ClckT url m)]] -> [XMLGenT (ClckT url m) [ChildType (ClckT url m)]] -> XMLGenT (ClckT url m) (XMLType (ClckT url m)) #

genEElement :: Name (StringType (ClckT url m)) -> [XMLGenT (ClckT url m) [AttributeType (ClckT url m)]] -> XMLGenT (ClckT url m) (XMLType (ClckT url m)) #

xmlToChild :: XMLType (ClckT url m) -> ChildType (ClckT url m) #

pcdataToChild :: StringType (ClckT url m) -> ChildType (ClckT url m) #

(Functor m, Monad m) => XMLGenerator (ClckT url m) Source # 
Instance details

Defined in Clckwrks.Monad

(Functor m, MonadIO m) => IntegerSupply (ClckT url m) Source # 
Instance details

Defined in Clckwrks.Monad

Methods

nextInteger :: ClckT url m Integer #

Monad m => MonadRoute (ClckT url m) Source # 
Instance details

Defined in Clckwrks.Monad

Associated Types

type URL (ClckT url m) :: Type #

Methods

askRouteFn :: ClckT url m (URL (ClckT url m) -> [(Text, Maybe Text)] -> Text) #

(Functor m, Monad m) => EmbedAsChild (ClckT url m) Content Source # 
Instance details

Defined in Clckwrks.Monad

Methods

asChild :: Content -> GenChildList (ClckT url m) #

(Functor m, Monad m) => EmbedAsChild (ClckT url m) UTCTime Source # 
Instance details

Defined in Clckwrks.Monad

Methods

asChild :: UTCTime -> GenChildList (ClckT url m) #

(Functor m, Monad m) => EmbedAsChild (ClckT url m) () Source # 
Instance details

Defined in Clckwrks.Monad

Methods

asChild :: () -> GenChildList (ClckT url m) #

(Functor m, MonadIO m, Happstack m) => EmbedAsChild (ClckT url m) ClckFormError Source # 
Instance details

Defined in Clckwrks.Monad

(Functor m, Monad m) => EmbedAsChild (ClckT url m) Html Source # 
Instance details

Defined in Clckwrks.Monad

Methods

asChild :: Html -> GenChildList (ClckT url m) #

(Functor m, Monad m) => EmbedAsChild (ClckT url m) XML Source # 
Instance details

Defined in Clckwrks.Monad

Methods

asChild :: XML -> GenChildList (ClckT url m) #

(Functor m, Monad m) => EmbedAsChild (ClckT url m) Text Source # 
Instance details

Defined in Clckwrks.Monad

Methods

asChild :: Text -> GenChildList (ClckT url m) #

(Functor m, Monad m) => EmbedAsChild (ClckT url m) Text Source # 
Instance details

Defined in Clckwrks.Monad

Methods

asChild :: Text -> GenChildList (ClckT url m) #

(Functor m, Monad m) => EmbedAsChild (ClckT url m) Float Source # 
Instance details

Defined in Clckwrks.Monad

Methods

asChild :: Float -> GenChildList (ClckT url m) #

(Functor m, Monad m) => EmbedAsChild (ClckT url m) Double Source # 
Instance details

Defined in Clckwrks.Monad

Methods

asChild :: Double -> GenChildList (ClckT url m) #

(Functor m, Monad m) => EmbedAsChild (ClckT url m) Integer Source # 
Instance details

Defined in Clckwrks.Monad

Methods

asChild :: Integer -> GenChildList (ClckT url m) #

(Functor m, Monad m) => EmbedAsChild (ClckT url m) Int Source # 
Instance details

Defined in Clckwrks.Monad

Methods

asChild :: Int -> GenChildList (ClckT url m) #

(Functor m, Monad m) => EmbedAsChild (ClckT url m) String Source # 
Instance details

Defined in Clckwrks.Monad

Methods

asChild :: String -> GenChildList (ClckT url m) #

(Functor m, Monad m) => EmbedAsChild (ClckT url m) Char Source # 
Instance details

Defined in Clckwrks.Monad

Methods

asChild :: Char -> GenChildList (ClckT url m) #

(Functor m, Monad m) => EmbedAsAttr (ClckT url m) Attribute Source # 
Instance details

Defined in Clckwrks.Monad

Methods

asAttr :: Attribute -> GenAttributeList (ClckT url m) #

(Functor m, Monad m) => SetAttr (ClckT url m) XML Source # 
Instance details

Defined in Clckwrks.Monad

Methods

setAttr :: XML -> GenAttribute (ClckT url m) -> GenXML (ClckT url m) #

setAll :: XML -> GenAttributeList (ClckT url m) -> GenXML (ClckT url m) #

(Functor m, Monad m) => AppendChild (ClckT url m) XML Source # 
Instance details

Defined in Clckwrks.Monad

Methods

appChild :: XML -> GenChild (ClckT url m) -> GenXML (ClckT url m) #

appAll :: XML -> GenChildList (ClckT url m) -> GenXML (ClckT url m) #

(Functor m, Monad m) => GetAcidState (ClckT url m) ProfileDataState Source # 
Instance details

Defined in Clckwrks.Monad

(Functor m, Monad m) => GetAcidState (ClckT url m) NavBarState Source # 
Instance details

Defined in Clckwrks.Monad

(Functor m, Monad m) => GetAcidState (ClckT url m) CoreState Source # 
Instance details

Defined in Clckwrks.Monad

(Functor m, Monad m, EmbedAsChild (ClckT url m) a) => EmbedAsChild (ClckT url m) (Maybe a) Source # 
Instance details

Defined in Clckwrks.Monad

Methods

asChild :: Maybe a -> GenChildList (ClckT url m) #

(Functor m, MonadIO m, EmbedAsChild (ClckT url m) a) => EmbedAsChild (ClckT url m) (IO a) Source # 
Instance details

Defined in Clckwrks.Monad

Methods

asChild :: IO a -> GenChildList (ClckT url m) #

(Functor m, Monad m, IsName n Text) => EmbedAsAttr (ClckT url m) (Attr n Text) Source # 
Instance details

Defined in Clckwrks.Monad

Methods

asAttr :: Attr n Text -> GenAttributeList (ClckT url m) #

(Functor m, Monad m, IsName n Text) => EmbedAsAttr (ClckT url m) (Attr n Text) Source # 
Instance details

Defined in Clckwrks.Monad

Methods

asAttr :: Attr n Text -> GenAttributeList (ClckT url m) #

(Functor m, Monad m, IsName n Text) => EmbedAsAttr (ClckT url m) (Attr n Integer) Source # 
Instance details

Defined in Clckwrks.Monad

Methods

asAttr :: Attr n Integer -> GenAttributeList (ClckT url m) #

(Functor m, Monad m, IsName n Text) => EmbedAsAttr (ClckT url m) (Attr n Int) Source # 
Instance details

Defined in Clckwrks.Monad

Methods

asAttr :: Attr n Int -> GenAttributeList (ClckT url m) #

(Functor m, Monad m, IsName n Text) => EmbedAsAttr (ClckT url m) (Attr n Bool) Source # 
Instance details

Defined in Clckwrks.Monad

Methods

asAttr :: Attr n Bool -> GenAttributeList (ClckT url m) #

(Functor m, Monad m, IsName n Text) => EmbedAsAttr (ClckT url m) (Attr n Char) Source # 
Instance details

Defined in Clckwrks.Monad

Methods

asAttr :: Attr n Char -> GenAttributeList (ClckT url m) #

(Functor m, Monad m, IsName n Text) => EmbedAsAttr (ClckT url m) (Attr n String) Source # 
Instance details

Defined in Clckwrks.Monad

Methods

asAttr :: Attr n String -> GenAttributeList (ClckT url m) #

(EmbedAsChild (ClckT url1 m) a, url1 ~ url2) => EmbedAsChild (ClckT url1 m) (ClckT url2 m a) Source # 
Instance details

Defined in Clckwrks.Monad

Methods

asChild :: ClckT url2 m a -> GenChildList (ClckT url1 m) #

newtype AttributeType (ClckT url m) Source # 
Instance details

Defined in Clckwrks.Monad

newtype ChildType (ClckT url m) Source # 
Instance details

Defined in Clckwrks.Monad

newtype ChildType (ClckT url m) = ClckChild {}
type StringType (ClckT url m) Source # 
Instance details

Defined in Clckwrks.Monad

type StringType (ClckT url m) = Text
type XMLType (ClckT url m) Source # 
Instance details

Defined in Clckwrks.Monad

type XMLType (ClckT url m) = XML
type URL (ClckT url m) Source # 
Instance details

Defined in Clckwrks.Monad

type URL (ClckT url m) = url

type ClckFormT error m = Form m [Input] error [XMLGenT m XML] () Source #

ClckForm - type for reform forms

data ClckFormError Source #

error returned when a reform Form fails to validate

data family ChildType (m :: Type -> Type) :: Type #

Instances
XMLGen m => EmbedAsChild m (ChildType m) 
Instance details

Defined in HSP.XMLGenerator

Methods

asChild :: ChildType m -> GenChildList m #

newtype ChildType (HSPT XML m) 
Instance details

Defined in HSP.Monad

newtype ChildType (RouteT url m) 
Instance details

Defined in Web.Routes.XMLGenT

newtype ChildType (RouteT url m) = UChild {}
newtype ChildType (ClckT url m) Source # 
Instance details

Defined in Clckwrks.Monad

newtype ChildType (ClckT url m) = ClckChild {}

data ClckwrksConfig Source #

Constructors

ClckwrksConfig 

Fields

data family AttributeType (m :: Type -> Type) :: Type #

Instances
XMLGen m => EmbedAsAttr m (AttributeType m) 
Instance details

Defined in HSP.XMLGenerator

newtype AttributeType (HSPT XML m) 
Instance details

Defined in HSP.Monad

newtype AttributeType (RouteT url m) 
Instance details

Defined in Web.Routes.XMLGenT

newtype AttributeType (RouteT url m) = UAttr {}
newtype AttributeType (ClckT url m) Source # 
Instance details

Defined in Clckwrks.Monad

newtype ThemeStyleId Source #

Constructors

ThemeStyleId 

Fields

Instances
Eq ThemeStyleId Source # 
Instance details

Defined in Clckwrks.Monad

Data ThemeStyleId Source # 
Instance details

Defined in Clckwrks.Monad

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ThemeStyleId -> c ThemeStyleId #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ThemeStyleId #

toConstr :: ThemeStyleId -> Constr #

dataTypeOf :: ThemeStyleId -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ThemeStyleId) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ThemeStyleId) #

gmapT :: (forall b. Data b => b -> b) -> ThemeStyleId -> ThemeStyleId #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ThemeStyleId -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ThemeStyleId -> r #

gmapQ :: (forall d. Data d => d -> u) -> ThemeStyleId -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ThemeStyleId -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ThemeStyleId -> m ThemeStyleId #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ThemeStyleId -> m ThemeStyleId #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ThemeStyleId -> m ThemeStyleId #

Ord ThemeStyleId Source # 
Instance details

Defined in Clckwrks.Monad

Read ThemeStyleId Source # 
Instance details

Defined in Clckwrks.Monad

Show ThemeStyleId Source # 
Instance details

Defined in Clckwrks.Monad

SafeCopy ThemeStyleId Source # 
Instance details

Defined in Clckwrks.Monad

calcBaseURI :: ClckwrksConfig -> Text Source #

calculate the baseURI from the clckHostname, clckPort and clckHidePort options

evalClckT Source #

Arguments

:: Monad m 
=> (url -> [(Text, Maybe Text)] -> Text)

function to act as showURLParams

-> ClckState

initial ClckState

-> ClckT url m a

ClckT to evaluate

-> m a 

evaluate a ClckT returning the inner monad

similar to evalStateT.

execClckT Source #

Arguments

:: Monad m 
=> (url -> [(Text, Maybe Text)] -> Text)

function to act as showURLParams

-> ClckState

initial ClckState

-> ClckT url m a

ClckT to evaluate

-> m ClckState 

execute a ClckT returning the final ClckState

similar to execStateT.

runClckT Source #

Arguments

:: Monad m 
=> (url -> [(Text, Maybe Text)] -> Text)

function to act as showURLParams

-> ClckState

initial ClckState

-> ClckT url m a

ClckT to evaluate

-> m (a, ClckState) 

run a ClckT

similar to runStateT.

mapClckT Source #

Arguments

:: (m (a, ClckState) -> n (b, ClckState))

transformation function

-> ClckT url m a

initial monad

-> ClckT url n b 

map a transformation function over the inner monad

similar to mapStateT

withRouteClckT :: ((url' -> [(Text, Maybe Text)] -> Text) -> url -> [(Text, Maybe Text)] -> Text) -> ClckT url m a -> ClckT url' m a Source #

change the route url

data ClckState Source #

Constructors

ClckState 

Fields

Instances
Monad m => MonadState ClckState (ClckT url m) Source # 
Instance details

Defined in Clckwrks.Monad

Methods

get :: ClckT url m ClckState #

put :: ClckState -> ClckT url m () #

state :: (ClckState -> (a, ClckState)) -> ClckT url m a #

data Content Source #

a wrapper which identifies how to treat different Text values when attempting to embed them.

In general Content values have already been flattenpreprocessedetc and are now basic formats like text/plain, text/html, etc

Instances
Eq Content Source # 
Instance details

Defined in Clckwrks.Monad

Methods

(==) :: Content -> Content -> Bool #

(/=) :: Content -> Content -> Bool #

Data Content Source # 
Instance details

Defined in Clckwrks.Monad

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Content -> c Content #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Content #

toConstr :: Content -> Constr #

dataTypeOf :: Content -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Content) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Content) #

gmapT :: (forall b. Data b => b -> b) -> Content -> Content #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Content -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Content -> r #

gmapQ :: (forall d. Data d => d -> u) -> Content -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Content -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Content -> m Content #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Content -> m Content #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Content -> m Content #

Ord Content Source # 
Instance details

Defined in Clckwrks.Monad

Read Content Source # 
Instance details

Defined in Clckwrks.Monad

Show Content Source # 
Instance details

Defined in Clckwrks.Monad

(Functor m, Monad m) => EmbedAsChild (ClckT url m) Content Source # 
Instance details

Defined in Clckwrks.Monad

Methods

asChild :: Content -> GenChildList (ClckT url m) #

addAdminMenu :: Monad m => (Text, [(Set Role, Text, Text)]) -> ClckT url m () Source #

add an Admin menu

appendRequestInit :: Monad m => ServerPart () -> ClckT url m () Source #

append an action to the request init

addPreProc :: MonadIO m => Plugins theme n hook config ClckPluginsSt -> (forall mm. (Functor mm, MonadIO mm, Happstack mm) => Text -> ClckT ClckURL mm Text) -> m () Source #

addNavBarCallback :: MonadIO m => Plugins theme n hook config ClckPluginsSt -> ClckT ClckURL IO (String, [NamedLink]) -> m () Source #

getPreProcessors :: MonadIO m => Plugins theme n hook config ClckPluginsSt -> forall mm. (Functor mm, MonadIO mm, Happstack mm) => ClckT url m [Text -> ClckT ClckURL mm Text] Source #

getEnableAnalytics :: (Functor m, MonadState ClckState m) => m Bool Source #

get the Bool value indicating if Google Analytics should be enabled or not

googleAnalytics :: XMLGenT (Clck url) XML Source #

create a google analytics tracking code block

This will under two different conditions:

getUnique :: (Functor m, MonadIO m) => ClckT url m Integer Source #

get a unique Integer.

Only unique for the current request

setUnique :: (Functor m, MonadIO m) => Integer -> ClckT url m () Source #

query :: forall event m. (QueryEvent event, GetAcidState m (EventState event), Functor m, MonadIO m, MonadState ClckState m) => event -> m (EventResult event) Source #

similar to the normal acid-state query except it automatically gets the correct AcidState handle from the environment

update :: forall event m. (UpdateEvent event, GetAcidState m (EventState event), Functor m, MonadIO m, MonadState ClckState m) => event -> m (EventResult event) Source #

similar to the normal acid-state update except it automatically gets the correct AcidState handle from the environment

nestURL :: (url1 -> url2) -> ClckT url1 m a -> ClckT url2 m a Source #

withAbs :: Happstack m => ClckT url m a -> ClckT url m a Source #

withAbs' :: Text -> ClckT url m a -> ClckT url m a Source #

segments :: Text -> Parser a -> Parser [Segment a] Source #

transform :: Monad m => (cmd -> m Builder) -> [Segment cmd] -> m Builder Source #

module HSP.XML

Orphan instances

GetAcidState m st => GetAcidState (XMLGenT m) st Source # 
Instance details