'{-' Comment.Multiline '# LANGUAGE DeriveDataTypeable, FlexibleContexts, GeneralizedNewtypeDeriving\n , MultiParamTypeClasses, OverloadedStrings, ScopedTypeVariables, TemplateHaskell\n , TypeFamilies, FlexibleInstances #' Comment.Multiline '-}' Comment.Multiline '\n' Text 'module' Keyword.Reserved ' ' Text 'Main' Name.Namespace ' ' Text 'where' Keyword.Reserved '\n' Text 'import' Keyword.Reserved ' ' Text 'Control.Applicative' Name.Namespace ' ' Text '(' Punctuation 'Applicative' Keyword.Type ',' Punctuation ' ' Text 'Alternative' Keyword.Type ',' Punctuation ' ' Text '(' Punctuation '<$>' Operator ')' Punctuation ')' Punctuation '\n' Text 'import' Keyword.Reserved ' ' Text 'Control.Exception.Lifted' Name.Namespace ' ' Text '(' Punctuation 'bracket' Name.Function ')' Punctuation '\n' Text 'import' Keyword.Reserved ' ' Text 'Control.Monad.Trans.Control' Name.Namespace ' ' Text '(' Punctuation 'MonadBaseControl' Keyword.Type ')' Punctuation '\n' Text 'import' Keyword.Reserved ' ' Text 'Control.Monad' Name.Namespace ' ' Text '(' Punctuation 'MonadPlus' Keyword.Type ',' Punctuation ' ' Text 'mplus' Name.Function ')' Punctuation '\n' Text 'import' Keyword.Reserved ' ' Text 'Control.Monad.Reader' Name.Namespace ' ' Text '(' Punctuation 'MonadReader' Keyword.Type ',' Punctuation ' ' Text 'ReaderT' Keyword.Type '(' Punctuation '..' Operator ')' Punctuation ',' Punctuation ' ' Text 'ask' Name.Function ')' Punctuation '\n' Text 'import' Keyword.Reserved ' ' Text 'Control.Monad.Trans' Name.Namespace ' ' Text '(' Punctuation 'MonadIO' Keyword.Type '(' Punctuation '..' Operator ')' Punctuation ')' Punctuation '\n' Text 'import' Keyword.Reserved ' ' Text 'Data.Acid' Name.Namespace ' ' Text '(' Punctuation ' ' Text 'AcidState' Keyword.Type '(' Punctuation '..' Operator ')' Punctuation ',' Punctuation ' ' Text 'EventState' Keyword.Type '(' Punctuation '..' Operator ')' Punctuation ',' Punctuation ' ' Text 'EventResult' Keyword.Type '(' Punctuation '..' Operator ')' Punctuation '\n ' Text ',' Punctuation ' ' Text 'Query' Keyword.Type '(' Punctuation '..' Operator ')' Punctuation ',' Punctuation ' ' Text 'QueryEvent' Keyword.Type '(' Punctuation '..' Operator ')' Punctuation ',' Punctuation ' ' Text 'Update' Keyword.Type '(' Punctuation '..' Operator ')' Punctuation ',' Punctuation ' ' Text 'UpdateEvent' Keyword.Type '(' Punctuation '..' Operator ')' Punctuation '\n ' Text ',' Punctuation ' ' Text 'IsAcidic' Keyword.Type '(' Punctuation '..' Operator ')' Punctuation ',' Punctuation ' ' Text 'makeAcidic' Name.Function ',' Punctuation ' ' Text 'openLocalState' Name.Function '\n ' Text ')' Punctuation '\n' Text 'import' Keyword.Reserved ' ' Text 'Data.Acid.Local' Name.Namespace ' ' Text '(' Punctuation ' ' Text 'createCheckpointAndClose' Name.Function '\n ' Text ',' Punctuation ' ' Text 'openLocalStateFrom' Name.Function '\n ' Text ')' Punctuation '\n' Text 'import' Keyword.Reserved ' ' Text 'Data.Acid.Advanced' Name.Namespace ' ' Text '(' Punctuation "query'" Name.Function ',' Punctuation ' ' Text "update'" Name.Function ')' Punctuation '\n' Text 'import' Keyword.Reserved ' ' Text 'Data.Maybe' Name.Namespace ' ' Text '(' Punctuation 'fromMaybe' Name.Function ')' Punctuation '\n' Text 'import' Keyword.Reserved ' ' Text 'Data.SafeCopy' Name.Namespace ' ' Text '(' Punctuation 'SafeCopy' Keyword.Type ',' Punctuation ' ' Text 'base' Name.Function ',' Punctuation ' ' Text 'deriveSafeCopy' Name.Function ')' Punctuation '\n' Text 'import' Keyword.Reserved ' ' Text 'Data.Data' Name.Namespace ' ' Text '(' Punctuation 'Data' Keyword.Type ',' Punctuation ' ' Text 'Typeable' Keyword.Type ')' Punctuation '\n' Text 'import' Keyword.Reserved ' ' Text 'Data.Lens' Name.Namespace ' ' Text '(' Punctuation '(' Punctuation '%=' Operator ')' Punctuation ',' Punctuation ' ' Text '(' Punctuation '!=' Operator ')' Punctuation ')' Punctuation '\n' Text 'import' Keyword.Reserved ' ' Text 'Data.Lens.Template' Name.Namespace ' ' Text '(' Punctuation 'makeLens' Name.Function ')' Punctuation '\n' Text 'import' Keyword.Reserved ' ' Text 'Data.Text.Lazy' Name.Namespace ' ' Text '(' Punctuation 'Text' Keyword.Type ')' Punctuation '\n' Text 'import' Keyword.Reserved ' ' Text 'Happstack.Server' Name.Namespace ' ' Text '(' Punctuation ' ' Text 'Happstack' Keyword.Type ',' Punctuation ' ' Text 'HasRqData' Keyword.Type ',' Punctuation ' ' Text 'Method' Keyword.Type '(' Punctuation 'GET' Keyword.Type ',' Punctuation ' ' Text 'POST' Keyword.Type ')' Punctuation ',' Punctuation ' ' Text 'Request' Keyword.Type '(' Punctuation 'rqMethod' Name.Function ')' Punctuation '\n ' Text ',' Punctuation ' ' Text 'Response' Keyword.Type '\n ' Text ',' Punctuation ' ' Text 'ServerPartT' Keyword.Type '(' Punctuation '..' Operator ')' Punctuation ',' Punctuation ' ' Text 'WebMonad' Keyword.Type ',' Punctuation ' ' Text 'FilterMonad' Keyword.Type ',' Punctuation ' ' Text 'ServerMonad' Keyword.Type '\n ' Text ',' Punctuation ' ' Text 'askRq' Name.Function ',' Punctuation ' ' Text 'decodeBody' Name.Function ',' Punctuation ' ' Text 'dir' Name.Function ',' Punctuation ' ' Text 'defaultBodyPolicy' Name.Function ',' Punctuation ' ' Text 'lookText' Name.Function '\n ' Text ',' Punctuation ' ' Text 'mapServerPartT' Name.Function ',' Punctuation ' ' Text 'nullConf' Name.Function ',' Punctuation ' ' Text 'nullDir' Name.Function ',' Punctuation ' ' Text 'ok' Name.Function ',' Punctuation ' ' Text 'simpleHTTP' Name.Function '\n ' Text ',' Punctuation ' ' Text 'toResponse' Name.Function '\n ' Text ')' Punctuation '\n' Text 'import' Keyword.Reserved ' ' Text 'Prelude' Name.Namespace ' ' Text 'hiding' Keyword ' ' Text '(' Punctuation 'head' Name.Function ',' Punctuation ' ' Text 'id' Name.Function ')' Punctuation '\n' Text 'import' Keyword.Reserved ' ' Text 'System.FilePath' Name.Namespace ' ' Text '(' Punctuation '(' Punctuation '' Operator ')' Punctuation ')' Punctuation '\n' Text 'import' Keyword.Reserved ' ' Text 'Text.Blaze' Name.Namespace ' ' Text '(' Punctuation '(' Punctuation '!' Operator ')' Punctuation ')' Punctuation '\n' Text 'import' Keyword.Reserved ' ' Text 'Text.Blaze.Html4.Strict' Name.Namespace ' ' Text '(' Punctuation 'body' Name.Function ',' Punctuation ' ' Text 'head' Name.Function ',' Punctuation ' ' Text 'html' Name.Function ',' Punctuation ' ' Text 'input' Name.Function ',' Punctuation ' ' Text 'form' Name.Function ',' Punctuation ' ' Text 'label' Name.Function ',' Punctuation ' ' Text 'p' Name.Function ',' Punctuation ' ' Text 'title' Name.Function ',' Punctuation ' ' Text 'toHtml' Name.Function ')' Punctuation '\n' Text 'import' Keyword.Reserved ' ' Text 'Text.Blaze.Html4.Strict.Attributes' Name.Namespace ' ' Text '(' Punctuation 'action' Name.Function ',' Punctuation ' ' Text 'enctype' Name.Function ',' Punctuation ' ' Text 'for' Name.Function ',' Punctuation ' ' Text 'id' Name.Function ',' Punctuation ' ' Text 'method' Name.Function ',' Punctuation ' ' Text 'name' Name.Function ',' Punctuation ' ' Text 'type_' Name.Function ',' Punctuation ' ' Text 'value' Name.Function ')' Punctuation '\n' Text 'class' Keyword.Reserved ' ' Text 'HasAcidState' Keyword.Type ' ' Text 'm' Name ' ' Text 'st' Name ' ' Text 'where' Keyword.Reserved '\n ' Text 'getAcidState' Name ' ' Text '::' Operator.Word ' ' Text 'm' Name ' ' Text '(' Punctuation 'AcidState' Keyword.Type ' ' Text 'st' Name ')' Punctuation '\n' Text 'query' Name.Function ' ' Text '::' Operator.Word ' ' Text 'forall' Name ' ' Text 'event' Name ' ' Text 'm' Name '.' Operator ' \n ' Text '(' Punctuation ' ' Text 'Functor' Keyword.Type ' ' Text 'm' Name '\n ' Text ',' Punctuation ' ' Text 'MonadIO' Keyword.Type ' ' Text 'm' Name '\n ' Text ',' Punctuation ' ' Text 'QueryEvent' Keyword.Type ' ' Text 'event' Name '\n ' Text ',' Punctuation ' ' Text 'HasAcidState' Keyword.Type ' ' Text 'm' Name ' ' Text '(' Punctuation 'EventState' Keyword.Type ' ' Text 'event' Name ')' Punctuation '\n ' Text ')' Punctuation ' ' Text '=>' Operator.Word ' \n ' Text 'event' Name '\n ' Text '->' Operator.Word ' ' Text 'm' Name ' ' Text '(' Punctuation 'EventResult' Keyword.Type ' ' Text 'event' Name ')' Punctuation '\n' Text 'query' Name.Function ' ' Text 'event' Name ' ' Text '=' Operator.Word '\n ' Text 'do' Keyword.Reserved ' ' Text 'as' Name ' ' Text '<-' Operator.Word ' ' Text 'getAcidState' Name '\n ' Text "query'" Name ' ' Text '(' Punctuation 'as' Name ' ' Text '::' Operator.Word ' ' Text 'AcidState' Keyword.Type ' ' Text '(' Punctuation 'EventState' Keyword.Type ' ' Text 'event' Name ')' Punctuation ')' Punctuation ' ' Text 'event' Name '\n' Text 'update' Name.Function ' ' Text '::' Operator.Word ' ' Text 'forall' Name ' ' Text 'event' Name ' ' Text 'm' Name '.' Operator ' \n ' Text '(' Punctuation ' ' Text 'Functor' Keyword.Type ' ' Text 'm' Name '\n ' Text ',' Punctuation ' ' Text 'MonadIO' Keyword.Type ' ' Text 'm' Name '\n ' Text ',' Punctuation ' ' Text 'UpdateEvent' Keyword.Type ' ' Text 'event' Name '\n ' Text ',' Punctuation ' ' Text 'HasAcidState' Keyword.Type ' ' Text 'm' Name ' ' Text '(' Punctuation 'EventState' Keyword.Type ' ' Text 'event' Name ')' Punctuation '\n ' Text ')' Punctuation ' ' Text '=>' Operator.Word ' \n ' Text 'event' Name ' \n ' Text '->' Operator.Word ' ' Text 'm' Name ' ' Text '(' Punctuation 'EventResult' Keyword.Type ' ' Text 'event' Name ')' Punctuation '\n' Text 'update' Name.Function ' ' Text 'event' Name ' ' Text '=' Operator.Word '\n ' Text 'do' Keyword.Reserved ' ' Text 'as' Name ' ' Text '<-' Operator.Word ' ' Text 'getAcidState' Name '\n ' Text "update'" Name ' ' Text '(' Punctuation 'as' Name ' ' Text '::' Operator.Word ' ' Text 'AcidState' Keyword.Type ' ' Text '(' Punctuation 'EventState' Keyword.Type ' ' Text 'event' Name ')' Punctuation ')' Punctuation ' ' Text 'event' Name '\n' Text '-- | bracket the opening and close of the `AcidState` handle. ' Comment.Single '\n\n' Text '-- automatically creates a checkpoint on close' Comment.Single '\n' Text 'withLocalState' Name.Function ' ' Text '::' Operator.Word ' ' Text '(' Punctuation 'MonadBaseControl' Keyword.Type ' ' Text 'IO' Keyword.Type ' ' Text 'm' Name ',' Punctuation ' ' Text 'MonadIO' Keyword.Type ' ' Text 'm' Name ',' Punctuation ' ' Text 'IsAcidic' Keyword.Type ' ' Text 'st' Name ',' Punctuation ' ' Text 'Typeable' Keyword.Type ' ' Text 'st' Name ')' Punctuation ' ' Text '=>' Operator.Word ' \n ' Text 'Maybe' Keyword.Type ' ' Text 'FilePath' Keyword.Type ' ' Text '-- ^ path to state directory' Comment.Single '\n ' Text '->' Operator.Word ' ' Text 'st' Name ' ' Text '-- ^ initial state value' Comment.Single '\n ' Text '->' Operator.Word ' ' Text '(' Punctuation 'AcidState' Keyword.Type ' ' Text 'st' Name ' ' Text '->' Operator.Word ' ' Text 'm' Name ' ' Text 'a' Name ')' Punctuation ' ' Text '-- ^ function which uses the `AcidState` handle' Comment.Single '\n ' Text '->' Operator.Word ' ' Text 'm' Name ' ' Text 'a' Name '\n' Text 'withLocalState' Name.Function ' ' Text 'mPath' Name ' ' Text 'initialState' Name ' ' Text '=' Operator.Word '\n ' Text 'bracket' Name ' ' Text '(' Punctuation 'liftIO' Name ' ' Text '$' Operator ' ' Text '(' Punctuation 'maybe' Name ' ' Text 'openLocalState' Name ' ' Text 'openLocalStateFrom' Name ' ' Text 'mPath' Name ')' Punctuation ' ' Text 'initialState' Name ')' Punctuation '\n ' Text '(' Punctuation 'liftIO' Name ' ' Text '.' Operator ' ' Text 'createCheckpointAndClose' Name ')' Punctuation '\n' Text '-- State that stores a hit count' Comment.Single '\n\n' Text 'data' Keyword.Reserved ' ' Text 'CountState' Keyword.Type ' ' Text '=' Operator.Word ' ' Text 'CountState' Keyword.Type ' ' Text '{' Punctuation ' ' Text '_count' Name ' ' Text '::' Operator.Word ' ' Text 'Integer' Keyword.Type ' ' Text '}' Punctuation '\n ' Text 'deriving' Keyword.Reserved ' ' Text '(' Punctuation 'Eq' Keyword.Type ',' Punctuation ' ' Text 'Ord' Keyword.Type ',' Punctuation ' ' Text 'Data' Keyword.Type ',' Punctuation ' ' Text 'Typeable' Keyword.Type ',' Punctuation ' ' Text 'Show' Keyword.Type ')' Punctuation '\n\n' Text '$' Operator '(' Punctuation 'deriveSafeCopy' Name ' ' Text '0' Literal.Number.Integer ' ' Text "'base" Name ' ' Text "''CountState" Keyword.Type ')' Punctuation '\n' Text '$' Operator '(' Punctuation 'makeLens' Name ' ' Text "''CountState" Keyword.Type ')' Punctuation '\n\n' Text 'initialCountState' Name.Function ' ' Text '::' Operator.Word ' ' Text 'CountState' Keyword.Type '\n' Text 'initialCountState' Name.Function ' ' Text '=' Operator.Word ' ' Text 'CountState' Keyword.Type ' ' Text '{' Punctuation ' ' Text '_count' Name ' ' Text '=' Operator.Word ' ' Text '0' Literal.Number.Integer ' ' Text '}' Punctuation '\n\n' Text 'incCount' Name.Function ' ' Text '::' Operator.Word ' ' Text 'Update' Keyword.Type ' ' Text 'CountState' Keyword.Type ' ' Text 'Integer' Keyword.Type '\n' Text 'incCount' Name.Function ' ' Text '=' Operator.Word ' ' Text 'count' Name ' ' Text '%=' Operator ' ' Text 'succ' Name '\n\n' Text '$' Operator '(' Punctuation 'makeAcidic' Name ' ' Text "''CountState" Keyword.Type ' ' Text '[' Punctuation "'incCount" Name ']' Punctuation ')' Punctuation '\n' Text '-- State that stores a greeting' Comment.Single '\n' Text 'data' Keyword.Reserved ' ' Text 'GreetingState' Keyword.Type ' ' Text '=' Operator.Word ' ' Text 'GreetingState' Keyword.Type ' ' Text '{' Punctuation ' ' Text '_greeting' Name ' ' Text '::' Operator.Word ' ' Text 'Text' Keyword.Type ' ' Text '}' Punctuation '\n ' Text 'deriving' Keyword.Reserved ' ' Text '(' Punctuation 'Eq' Keyword.Type ',' Punctuation ' ' Text 'Ord' Keyword.Type ',' Punctuation ' ' Text 'Data' Keyword.Type ',' Punctuation ' ' Text 'Typeable' Keyword.Type ',' Punctuation ' ' Text 'Show' Keyword.Type ')' Punctuation '\n\n' Text '$' Operator '(' Punctuation 'deriveSafeCopy' Name ' ' Text '0' Literal.Number.Integer ' ' Text "'base" Name ' ' Text "''GreetingState" Keyword.Type ')' Punctuation '\n' Text '$' Operator '(' Punctuation 'makeLens' Name ' ' Text "''GreetingState" Keyword.Type ')' Punctuation '\n\n' Text 'initialGreetingState' Name.Function ' ' Text '::' Operator.Word ' ' Text 'GreetingState' Keyword.Type '\n' Text 'initialGreetingState' Name.Function ' ' Text '=' Operator.Word ' ' Text 'GreetingState' Keyword.Type ' ' Text '{' Punctuation ' ' Text '_greeting' Name ' ' Text '=' Operator.Word ' ' Text '"' Literal.String 'Hello' Literal.String '"' Literal.String ' ' Text '}' Punctuation '\n\n' Text 'getGreeting' Name.Function ' ' Text '::' Operator.Word ' ' Text 'Query' Keyword.Type ' ' Text 'GreetingState' Keyword.Type ' ' Text 'Text' Keyword.Type '\n' Text 'getGreeting' Name.Function ' ' Text '=' Operator.Word ' ' Text '_greeting' Name ' ' Text '<$>' Operator ' ' Text 'ask' Name '\n\n' Text 'setGreeting' Name.Function ' ' Text '::' Operator.Word ' ' Text 'Text' Keyword.Type ' ' Text '->' Operator.Word ' ' Text 'Update' Keyword.Type ' ' Text 'GreetingState' Keyword.Type ' ' Text 'Text' Keyword.Type '\n' Text 'setGreeting' Name.Function ' ' Text 'txt' Name ' ' Text '=' Operator.Word ' ' Text 'greeting' Name ' ' Text '!=' Operator ' ' Text 'txt' Name '\n\n' Text '$' Operator '(' Punctuation 'makeAcidic' Name ' ' Text "''GreetingState" Keyword.Type ' ' Text '[' Punctuation "'getGreeting" Name ',' Punctuation ' ' Text "'setGreeting" Name ']' Punctuation ')' Punctuation '\n' Text 'data' Keyword.Reserved ' ' Text 'Acid' Keyword.Type ' ' Text '=' Operator.Word ' ' Text 'Acid' Keyword.Type ' ' Text '{' Punctuation ' ' Text 'acidCountState' Name ' ' Text '::' Operator.Word ' ' Text 'AcidState' Keyword.Type ' ' Text 'CountState' Keyword.Type '\n ' Text ',' Punctuation ' ' Text 'acidGreetingState' Name ' ' Text '::' Operator.Word ' ' Text 'AcidState' Keyword.Type ' ' Text 'GreetingState' Keyword.Type '\n ' Text '}' Punctuation '\n\n' Text 'withAcid' Name.Function ' ' Text '::' Operator.Word ' ' Text 'Maybe' Keyword.Type ' ' Text 'FilePath' Keyword.Type ' ' Text '->' Operator.Word ' ' Text '(' Punctuation 'Acid' Keyword.Type ' ' Text '->' Operator.Word ' ' Text 'IO' Keyword.Type ' ' Text 'a' Name ')' Punctuation ' ' Text '->' Operator.Word ' ' Text 'IO' Keyword.Type ' ' Text 'a' Name '\n' Text 'withAcid' Name.Function ' ' Text 'mBasePath' Name ' ' Text 'action' Name ' ' Text '=' Operator.Word '\n ' Text 'let' Keyword.Reserved ' ' Text 'basePath' Name ' ' Text '=' Operator.Word ' ' Text 'fromMaybe' Name ' ' Text '"' Literal.String '_state' Literal.String '"' Literal.String ' ' Text 'mBasePath' Name '\n ' Text 'in' Keyword.Reserved ' ' Text 'withLocalState' Name ' ' Text '(' Punctuation 'Just' Keyword.Type ' ' Text '$' Operator ' ' Text 'basePath' Name ' ' Text '' Operator ' ' Text '"' Literal.String 'count' Literal.String '"' Literal.String ')' Punctuation ' ' Text 'initialCountState' Name ' ' Text '$' Operator ' ' Text '\\' Name.Function 'c' Name ' ' Text '->' Operator.Word '\n ' Text 'withLocalState' Name ' ' Text '(' Punctuation 'Just' Keyword.Type ' ' Text '$' Operator ' ' Text 'basePath' Name ' ' Text '' Operator ' ' Text '"' Literal.String 'greeting' Literal.String '"' Literal.String ')' Punctuation ' ' Text 'initialGreetingState' Name ' ' Text '$' Operator ' ' Text '\\' Name.Function 'g' Name ' ' Text '->' Operator.Word '\n ' Text 'action' Name ' ' Text '(' Punctuation 'Acid' Keyword.Type ' ' Text 'c' Name ' ' Text 'g' Name ')' Punctuation '\n' Text 'newtype' Keyword.Reserved ' ' Text 'App' Keyword.Type ' ' Text 'a' Name ' ' Text '=' Operator.Word ' ' Text 'App' Keyword.Type ' ' Text '{' Punctuation ' ' Text 'unApp' Name ' ' Text '::' Operator.Word ' ' Text 'ServerPartT' Keyword.Type ' ' Text '(' Punctuation 'ReaderT' Keyword.Type ' ' Text 'Acid' Keyword.Type ' ' Text 'IO' Keyword.Type ')' Punctuation ' ' Text 'a' Name ' ' Text '}' Punctuation '\n ' Text 'deriving' Keyword.Reserved ' ' Text '(' Punctuation ' ' Text 'Functor' Keyword.Type ',' Punctuation ' ' Text 'Alternative' Keyword.Type ',' Punctuation ' ' Text 'Applicative' Keyword.Type ',' Punctuation ' ' Text 'Monad' Keyword.Type ',' Punctuation ' ' Text 'MonadPlus' Keyword.Type ',' Punctuation ' ' Text 'MonadIO' Keyword.Type '\n ' Text ',' Punctuation ' ' Text 'HasRqData' Keyword.Type ',' Punctuation ' ' Text 'ServerMonad' Keyword.Type ' ' Text ',' Punctuation 'WebMonad' Keyword.Type ' ' Text 'Response' Keyword.Type ',' Punctuation ' ' Text 'FilterMonad' Keyword.Type ' ' Text 'Response' Keyword.Type '\n ' Text ',' Punctuation ' ' Text 'Happstack' Keyword.Type ',' Punctuation ' ' Text 'MonadReader' Keyword.Type ' ' Text 'Acid' Keyword.Type ')' Punctuation '\n\n' Text 'runApp' Name.Function ' ' Text '::' Operator.Word ' ' Text 'Acid' Keyword.Type ' ' Text '->' Operator.Word ' ' Text 'App' Keyword.Type ' ' Text 'a' Name ' ' Text '->' Operator.Word ' ' Text 'ServerPartT' Keyword.Type ' ' Text 'IO' Keyword.Type ' ' Text 'a' Name '\n' Text 'runApp' Name.Function ' ' Text 'acid' Name ' ' Text '(' Punctuation 'App' Keyword.Type ' ' Text 'sp' Name ')' Punctuation ' ' Text '=' Operator.Word ' ' Text 'mapServerPartT' Name ' ' Text '(' Punctuation 'flip' Name ' ' Text 'runReaderT' Name ' ' Text 'acid' Name ')' Punctuation ' ' Text 'sp' Name '\n' Text 'instance' Keyword.Reserved ' ' Text 'HasAcidState' Keyword.Type ' ' Text 'App' Keyword.Type ' ' Text 'CountState' Keyword.Type ' ' Text 'where' Keyword.Reserved '\n ' Text 'getAcidState' Name ' ' Text '=' Operator.Word ' ' Text 'acidCountState' Name ' ' Text '<$>' Operator ' ' Text 'ask' Name ' \n\n' Text 'instance' Keyword.Reserved ' ' Text 'HasAcidState' Keyword.Type ' ' Text 'App' Keyword.Type ' ' Text 'GreetingState' Keyword.Type ' ' Text 'where' Keyword.Reserved '\n ' Text 'getAcidState' Name ' ' Text '=' Operator.Word ' ' Text 'acidGreetingState' Name ' ' Text '<$>' Operator ' ' Text 'ask' Name '\n' Text 'page' Name.Function ' ' Text '::' Operator.Word ' ' Text 'App' Keyword.Type ' ' Text 'Response' Keyword.Type '\n' Text 'page' Name.Function ' ' Text '=' Operator.Word '\n ' Text 'do' Keyword.Reserved ' ' Text 'nullDir' Name '\n ' Text 'g' Name ' ' Text '<-' Operator.Word ' ' Text 'greet' Name '\n ' Text 'c' Name ' ' Text '<-' Operator.Word ' ' Text 'update' Name ' ' Text 'IncCount' Keyword.Type ' ' Text '-- ^ a CountState event' Comment.Single '\n ' Text 'ok' Name ' ' Text '$' Operator ' ' Text 'toResponse' Name ' ' Text '$' Operator '\n ' Text 'html' Name ' ' Text '$' Operator ' ' Text 'do' Keyword.Reserved '\n ' Text 'head' Name ' ' Text '$' Operator ' ' Text 'do' Keyword.Reserved '\n ' Text 'title' Name ' ' Text '"' Literal.String 'acid-state demo' Literal.String '"' Literal.String '\n ' Text 'body' Name ' ' Text '$' Operator ' ' Text 'do' Keyword.Reserved '\n ' Text 'form' Name ' ' Text '!' Operator ' ' Text 'action' Name ' ' Text '"' Literal.String '/' Literal.String '"' Literal.String ' ' Text '!' Operator ' ' Text 'method' Name ' ' Text '"' Literal.String 'POST' Literal.String '"' Literal.String ' ' Text '!' Operator ' ' Text 'enctype' Name ' ' Text '"' Literal.String 'multipart/form-data' Literal.String '"' Literal.String ' ' Text '$' Operator ' ' Text 'do' Keyword.Reserved '\n ' Text 'label' Name ' ' Text '"' Literal.String 'new message: ' Literal.String '"' Literal.String ' ' Text '!' Operator ' ' Text 'for' Name ' ' Text '"' Literal.String 'msg' Literal.String '"' Literal.String '\n ' Text 'input' Name ' ' Text '!' Operator ' ' Text 'type_' Name ' ' Text '"' Literal.String 'text' Literal.String '"' Literal.String ' ' Text '!' Operator ' ' Text 'id' Name ' ' Text '"' Literal.String 'msg' Literal.String '"' Literal.String ' ' Text '!' Operator ' ' Text 'name' Name ' ' Text '"' Literal.String 'greeting' Literal.String '"' Literal.String '\n ' Text 'input' Name ' ' Text '!' Operator ' ' Text 'type_' Name ' ' Text '"' Literal.String 'submit' Literal.String '"' Literal.String ' ' Text '!' Operator ' ' Text 'value' Name ' ' Text '"' Literal.String 'update message' Literal.String '"' Literal.String '\n ' Text 'p' Name ' ' Text '$' Operator ' ' Text 'toHtml' Name ' ' Text 'g' Name '\n ' Text 'p' Name ' ' Text '$' Operator ' ' Text 'do' Keyword.Reserved ' ' Text '"' Literal.String 'This page has been loaded ' Literal.String '"' Literal.String ' \n ' Text 'toHtml' Name ' ' Text 'c' Name '\n ' Text '"' Literal.String ' time(s).' Literal.String '"' Literal.String '\n ' Text 'where' Keyword.Reserved '\n ' Text 'greet' Name ' ' Text '=' Operator.Word '\n ' Text 'do' Keyword.Reserved ' ' Text 'm' Name ' ' Text '<-' Operator.Word ' ' Text 'rqMethod' Name ' ' Text '<$>' Operator ' ' Text 'askRq' Name '\n ' Text 'case' Keyword.Reserved ' ' Text 'm' Name ' ' Text 'of' Keyword.Reserved '\n ' Text 'POST' Keyword.Type ' ' Text '->' Operator.Word ' \n ' Text 'do' Keyword.Reserved ' ' Text 'decodeBody' Name ' ' Text '(' Punctuation 'defaultBodyPolicy' Name ' ' Text '"' Literal.String '/tmp/' Literal.String '"' Literal.String ' ' Text '0' Literal.Number.Integer ' ' Text '1000' Literal.Number.Integer ' ' Text '1000' Literal.Number.Integer ')' Punctuation '\n ' Text 'newGreeting' Name ' ' Text '<-' Operator.Word ' ' Text 'lookText' Name ' ' Text '"' Literal.String 'greeting' Literal.String '"' Literal.String '\n ' Text 'update' Name ' ' Text '(' Punctuation 'SetGreeting' Keyword.Type ' ' Text 'newGreeting' Name ')' Punctuation ' ' Text '-- ^ a GreetingState event' Comment.Single '\n ' Text 'return' Name ' ' Text 'newGreeting' Name '\n ' Text 'GET' Keyword.Type ' ' Text '->' Operator.Word ' \n ' Text 'do' Keyword.Reserved ' ' Text 'query' Name ' ' Text 'GetGreeting' Keyword.Type ' ' Text '-- ^ a GreetingState event' Comment.Single '\n' Text 'main' Name.Function ' ' Text '::' Operator.Word ' ' Text 'IO' Keyword.Type ' ' Text '()' Name.Builtin '\n' Text 'main' Name.Function ' ' Text '=' Operator.Word '\n ' Text 'withAcid' Name ' ' Text 'Nothing' Keyword.Type ' ' Text '$' Operator ' ' Text '\\' Name.Function 'acid' Name ' ' Text '->' Operator.Word '\n ' Text 'simpleHTTP' Name ' ' Text 'nullConf' Name ' ' Text '$' Operator ' ' Text 'runApp' Name ' ' Text 'acid' Name ' ' Text 'page' Name '\n' Text 'newtype' Keyword.Reserved ' ' Text 'FooState' Keyword.Type ' ' Text '=' Operator.Word ' ' Text 'FooState' Keyword.Type ' ' Text '{' Punctuation ' ' Text 'foo' Name ' ' Text '::' Operator.Word ' ' Text 'Text' Keyword.Type ' ' Text '}' Punctuation '\n ' Text 'deriving' Keyword.Reserved ' ' Text '(' Punctuation 'Eq' Keyword.Type ',' Punctuation ' ' Text 'Ord' Keyword.Type ',' Punctuation ' ' Text 'Data' Keyword.Type ',' Punctuation ' ' Text 'Typeable' Keyword.Type ',' Punctuation ' ' Text 'SafeCopy' Keyword.Type ')' Punctuation '\n\n' Text 'initialFooState' Name.Function ' ' Text '::' Operator.Word ' ' Text 'FooState' Keyword.Type '\n' Text 'initialFooState' Name.Function ' ' Text '=' Operator.Word ' ' Text 'FooState' Keyword.Type ' ' Text '{' Punctuation ' ' Text 'foo' Name ' ' Text '=' Operator.Word ' ' Text '"' Literal.String 'foo' Literal.String '"' Literal.String ' ' Text '}' Punctuation '\n\n' Text 'askFoo' Name.Function ' ' Text '::' Operator.Word ' ' Text 'Query' Keyword.Type ' ' Text 'FooState' Keyword.Type ' ' Text 'Text' Keyword.Type '\n' Text 'askFoo' Name.Function ' ' Text '=' Operator.Word ' ' Text 'foo' Name ' ' Text '<$>' Operator ' ' Text 'ask' Name '\n\n' Text '$' Operator '(' Punctuation 'makeAcidic' Name ' ' Text "''FooState" Keyword.Type ' ' Text '[' Punctuation "'askFoo" Name ']' Punctuation ')' Punctuation '\n' Text 'fooPlugin' Name.Function ' ' Text '::' Operator.Word ' ' Text '(' Punctuation 'Happstack' Keyword.Type ' ' Text 'm' Name ',' Punctuation ' ' Text 'HasAcidState' Keyword.Type ' ' Text 'm' Name ' ' Text 'FooState' Keyword.Type ')' Punctuation ' ' Text '=>' Operator.Word ' ' Text 'm' Name ' ' Text 'Response' Keyword.Type '\n' Text 'fooPlugin' Name.Function ' ' Text '=' Operator.Word '\n ' Text 'dir' Name ' ' Text '"' Literal.String 'foo' Literal.String '"' Literal.String ' ' Text '$' Operator ' ' Text 'do' Keyword.Reserved '\n ' Text 'txt' Name ' ' Text '<-' Operator.Word ' ' Text 'query' Name ' ' Text 'AskFoo' Keyword.Type '\n ' Text 'ok' Name ' ' Text '$' Operator ' ' Text 'toResponse' Name ' ' Text 'txt' Name '\n' Text 'data' Keyword.Reserved ' ' Text "Acid'" Keyword.Type ' ' Text '=' Operator.Word ' ' Text "Acid'" Keyword.Type ' ' Text '{' Punctuation ' ' Text "acidCountState'" Name ' ' Text '::' Operator.Word ' ' Text 'AcidState' Keyword.Type ' ' Text 'CountState' Keyword.Type '\n ' Text ',' Punctuation ' ' Text "acidGreetingState'" Name ' ' Text '::' Operator.Word ' ' Text 'AcidState' Keyword.Type ' ' Text 'GreetingState' Keyword.Type '\n ' Text ',' Punctuation ' ' Text "acidFooState'" Name ' ' Text '::' Operator.Word ' ' Text 'AcidState' Keyword.Type ' ' Text 'FooState' Keyword.Type '\n ' Text '}' Punctuation '\n' Text "withAcid'" Name.Function ' ' Text '::' Operator.Word ' ' Text 'Maybe' Keyword.Type ' ' Text 'FilePath' Keyword.Type ' ' Text '->' Operator.Word ' ' Text '(' Punctuation "Acid'" Keyword.Type ' ' Text '->' Operator.Word ' ' Text 'IO' Keyword.Type ' ' Text 'a' Name ')' Punctuation ' ' Text '->' Operator.Word ' ' Text 'IO' Keyword.Type ' ' Text 'a' Name '\n' Text "withAcid'" Name.Function ' ' Text 'mBasePath' Name ' ' Text 'action' Name ' ' Text '=' Operator.Word '\n ' Text 'let' Keyword.Reserved ' ' Text 'basePath' Name ' ' Text '=' Operator.Word ' ' Text 'fromMaybe' Name ' ' Text '"' Literal.String '_state' Literal.String '"' Literal.String ' ' Text 'mBasePath' Name '\n ' Text 'in' Keyword.Reserved ' ' Text 'withLocalState' Name ' ' Text '(' Punctuation 'Just' Keyword.Type ' ' Text '$' Operator ' ' Text 'basePath' Name ' ' Text '' Operator ' ' Text '"' Literal.String 'count' Literal.String '"' Literal.String ')' Punctuation ' ' Text 'initialCountState' Name ' ' Text '$' Operator ' ' Text '\\' Name.Function 'c' Name ' ' Text '->' Operator.Word '\n ' Text 'withLocalState' Name ' ' Text '(' Punctuation 'Just' Keyword.Type ' ' Text '$' Operator ' ' Text 'basePath' Name ' ' Text '' Operator ' ' Text '"' Literal.String 'greeting' Literal.String '"' Literal.String ')' Punctuation ' ' Text 'initialGreetingState' Name ' ' Text '$' Operator ' ' Text '\\' Name.Function 'g' Name ' ' Text '->' Operator.Word '\n ' Text 'withLocalState' Name ' ' Text '(' Punctuation 'Just' Keyword.Type ' ' Text '$' Operator ' ' Text 'basePath' Name ' ' Text '' Operator ' ' Text '"' Literal.String 'foo' Literal.String '"' Literal.String ')' Punctuation ' ' Text 'initialFooState' Name ' ' Text '$' Operator ' ' Text '\\' Name.Function 'f' Name ' ' Text '->' Operator.Word '\n ' Text 'action' Name ' ' Text '(' Punctuation "Acid'" Keyword.Type ' ' Text 'c' Name ' ' Text 'g' Name ' ' Text 'f' Name ')' Punctuation '\n' Text 'newtype' Keyword.Reserved ' ' Text "App'" Keyword.Type ' ' Text 'a' Name ' ' Text '=' Operator.Word ' ' Text "App'" Keyword.Type ' ' Text '{' Punctuation ' ' Text "unApp'" Name ' ' Text '::' Operator.Word ' ' Text 'ServerPartT' Keyword.Type ' ' Text '(' Punctuation 'ReaderT' Keyword.Type ' ' Text "Acid'" Keyword.Type ' ' Text 'IO' Keyword.Type ')' Punctuation ' ' Text 'a' Name ' ' Text '}' Punctuation '\n ' Text 'deriving' Keyword.Reserved ' ' Text '(' Punctuation ' ' Text 'Functor' Keyword.Type ',' Punctuation ' ' Text 'Alternative' Keyword.Type ',' Punctuation ' ' Text 'Applicative' Keyword.Type ',' Punctuation ' ' Text 'Monad' Keyword.Type ',' Punctuation ' ' Text 'MonadPlus' Keyword.Type ',' Punctuation ' ' Text 'MonadIO' Keyword.Type '\n ' Text ',' Punctuation ' ' Text 'HasRqData' Keyword.Type ',' Punctuation ' ' Text 'ServerMonad' Keyword.Type ' ' Text ',' Punctuation 'WebMonad' Keyword.Type ' ' Text 'Response' Keyword.Type ',' Punctuation ' ' Text 'FilterMonad' Keyword.Type ' ' Text 'Response' Keyword.Type '\n ' Text ',' Punctuation ' ' Text 'Happstack' Keyword.Type ',' Punctuation ' ' Text 'MonadReader' Keyword.Type ' ' Text "Acid'" Keyword.Type ')' Punctuation '\n\n' Text 'instance' Keyword.Reserved ' ' Text 'HasAcidState' Keyword.Type ' ' Text "App'" Keyword.Type ' ' Text 'FooState' Keyword.Type ' ' Text 'where' Keyword.Reserved '\n ' Text 'getAcidState' Name ' ' Text '=' Operator.Word ' ' Text "acidFooState'" Name ' ' Text '<$>' Operator ' ' Text 'ask' Name '\n' Text 'fooAppPlugin' Name.Function ' ' Text '::' Operator.Word ' ' Text "App'" Keyword.Type ' ' Text 'Response' Keyword.Type '\n' Text 'fooAppPlugin' Name.Function ' ' Text '=' Operator.Word ' ' Text 'fooPlugin' Name '\n' Text 'fooReaderPlugin' Name.Function ' ' Text '::' Operator.Word ' ' Text 'ReaderT' Keyword.Type ' ' Text '(' Punctuation 'AcidState' Keyword.Type ' ' Text 'FooState' Keyword.Type ')' Punctuation ' ' Text '(' Punctuation 'ServerPartT' Keyword.Type ' ' Text 'IO' Keyword.Type ')' Punctuation ' ' Text 'Response' Keyword.Type '\n' Text 'fooReaderPlugin' Name.Function ' ' Text '=' Operator.Word ' ' Text 'fooPlugin' Name '\n' Text 'instance' Keyword.Reserved ' ' Text 'HasAcidState' Keyword.Type ' ' Text '(' Punctuation 'ReaderT' Keyword.Type ' ' Text '(' Punctuation 'AcidState' Keyword.Type ' ' Text 'FooState' Keyword.Type ')' Punctuation ' ' Text '(' Punctuation 'ServerPartT' Keyword.Type ' ' Text 'IO' Keyword.Type ')' Punctuation ')' Punctuation ' ' Text 'FooState' Keyword.Type ' ' Text 'where' Keyword.Reserved '\n ' Text 'getAcidState' Name ' ' Text '=' Operator.Word ' ' Text 'ask' Name '\n' Text 'withFooPlugin' Name.Function ' ' Text '::' Operator.Word ' ' Text '(' Punctuation 'MonadIO' Keyword.Type ' ' Text 'm' Name ',' Punctuation ' ' Text 'MonadBaseControl' Keyword.Type ' ' Text 'IO' Keyword.Type ' ' Text 'm' Name ')' Punctuation ' ' Text '=>' Operator.Word ' \n ' Text 'FilePath' Keyword.Type ' ' Text '-- ^ path to state directory' Comment.Single '\n ' Text '->' Operator.Word ' ' Text '(' Punctuation 'ServerPartT' Keyword.Type ' ' Text 'IO' Keyword.Type ' ' Text 'Response' Keyword.Type ' ' Text '->' Operator.Word ' ' Text 'm' Name ' ' Text 'a' Name ')' Punctuation ' ' Text '-- ^ function that uses fooPlugin' Comment.Single '\n ' Text '->' Operator.Word ' ' Text 'm' Name ' ' Text 'a' Name '\n' Text 'withFooPlugin' Name.Function ' ' Text 'basePath' Name ' ' Text 'f' Name ' ' Text '=' Operator.Word '\n ' Text 'do' Keyword.Reserved ' ' Text 'withLocalState' Name ' ' Text '(' Punctuation 'Just' Keyword.Type ' ' Text '$' Operator ' ' Text 'basePath' Name ' ' Text '' Operator ' ' Text '"' Literal.String 'foo' Literal.String '"' Literal.String ')' Punctuation ' ' Text 'initialFooState' Name ' ' Text '$' Operator ' ' Text '\\' Name.Function 'fooState' Name ' ' Text '->' Operator.Word ' \n ' Text 'f' Name ' ' Text '$' Operator ' ' Text 'runReaderT' Name ' ' Text 'fooReaderPlugin' Name ' ' Text 'fooState' Name '\n' Text "main'" Name.Function ' ' Text '::' Operator.Word ' ' Text 'IO' Keyword.Type ' ' Text '()' Name.Builtin '\n' Text "main'" Name.Function ' ' Text '=' Operator.Word ' \n ' Text 'withFooPlugin' Name ' ' Text '"' Literal.String '_state' Literal.String '"' Literal.String ' ' Text '$' Operator ' ' Text '\\' Name.Function "fooPlugin'" Name ' ' Text '->' Operator.Word '\n ' Text 'withAcid' Name ' ' Text 'Nothing' Keyword.Type ' ' Text '$' Operator ' ' Text '\\' Name.Function 'acid' Name ' ' Text '->' Operator.Word '\n ' Text 'simpleHTTP' Name ' ' Text 'nullConf' Name ' ' Text '$' Operator ' ' Text "fooPlugin'" Name ' ' Text '`' Punctuation 'mplus' Name '`' Punctuation ' ' Text 'runApp' Name ' ' Text 'acid' Name ' ' Text 'page' Name '\n' Text