Hoogle Search

Within LTS Haskell 8.23 (ghc-8.0.2)

  1. setSessionData :: (Typeable a, MonadState (MFlowState view) m) => a -> m ()

    MFlow MFlow.Forms

    Set user-defined data in the context of the session. The data is indexed by type in a map. So the user can insert-retrieve different kinds of data in the session context. This example define addHistory and getHistory to maintain a Html log in the session of a Flow:

    newtype History = History ( Html) deriving Typeable
    setHistory html= setSessionData $ History html
    getHistory= getSessionData `onNothing` return (History mempty) >>= \(History h) -> return h
    addHistory html= do
    html' <- getHistory
    setHistory $ html' `mappend` html
    

  2. setSessionData :: (Typeable a, MonadState (MFlowState view) m) => a -> m ()

    MFlow MFlow.Forms.Internals

    Set user-defined data in the context of the session. The data is indexed by type in a map. So the user can insert-retrieve different kinds of data in the session context. This example define addHistory and getHistory to maintain a Html log in the session of a Flow:

    newtype History = History ( Html) deriving Typeable
    setHistory html= setSessionData $ History html
    getHistory= getSessionData `onNothing` return (History mempty) >>= \(History h) -> return h
    addHistory html= do
    html' <- getHistory
    setHistory $ html' `mappend` html
    

Page 1 of 1