Hoogle Search

Within LTS Haskell 24.52 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. sSequence :: forall (m :: Type -> Type) a (t1 :: t (m a)) . (STraversable t, SMonad m) => Sing t1 -> Sing (Apply (SequenceSym0 :: TyFun (t (m a)) (m (t a)) -> Type) t1)

    singletons-base Prelude.Singletons

    No documentation available.

  2. sSequenceA :: forall (f :: Type -> Type) a (t1 :: t (f a)) . (STraversable t, SApplicative f) => Sing t1 -> Sing (Apply (SequenceASym0 :: TyFun (t (f a)) (f (t a)) -> Type) t1)

    singletons-base Prelude.Singletons

    No documentation available.

  3. sSequence_ :: forall (t1 :: Type -> Type) (m :: Type -> Type) a (t2 :: t1 (m a)) . (SFoldable t1, SMonad m) => Sing t2 -> Sing (Apply (Sequence_Sym0 :: TyFun (t1 (m a)) (m ()) -> Type) t2)

    singletons-base Prelude.Singletons

    No documentation available.

  4. data Request

    snap-core Snap.Core

    Contains all of the information about an incoming HTTP request.

  5. getRequest :: MonadSnap m => m Request

    snap-core Snap.Core

    Grabs the Request object out of the Snap monad. Example:

    ghci> :set -XOverloadedStrings
    ghci> import qualified Data.Map as M
    ghci> import qualified Snap.Test as T
    ghci> let r = T.get "/foo/bar" M.empty
    ghci> T.runHandler r (writeBS . rqURI =<< getRequest)
    HTTP/1.1 200 OK
    server: Snap/test
    date: Sat, 02 Aug 2014 07:51:54 GMT
    
    /foo/bar
    

  6. getsRequest :: MonadSnap m => (Request -> a) -> m a

    snap-core Snap.Core

    Grabs something out of the Request object, using the given projection function. See gets. Example:

    ghci> :set -XOverloadedStrings
    ghci> import qualified Data.Map as M
    ghci> import qualified Snap.Test as T
    ghci> let r = T.get "/foo/bar" M.empty
    ghci> T.runHandler r (writeBS =<< getsRequest rqURI)
    HTTP/1.1 200 OK
    server: Snap/test
    date: Sat, 02 Aug 2014 07:51:54 GMT
    
    /foo/bar
    

  7. localRequest :: MonadSnap m => (Request -> Request) -> m a -> m a

    snap-core Snap.Core

    Runs a Snap action with a locally-modified Request state object. The Request object in the Snap monad state after the call to localRequest will be unchanged. Example:

    ghci> :set -XOverloadedStrings
    ghci> import qualified Data.Map as M
    ghci> import qualified Snap.Test as T
    ghci> let r = T.get "/foo/bar" M.empty
    ghci> r' <- T.buildRequest $ T.get "/bar/foo" M.empty
    ghci> let printRqURI = getsRequest rqURI >>= writeBS >> writeBS "\n"
    ghci> T.runHandler r (printRqURI >> localRequest (const r') printRqURI)
    HTTP/1.1 200 OK
    server: Snap/test
    date: Wed, 06 Aug 2014 15:34:12 GMT
    
    /foo/bar
    /bar/foo
    

  8. modifyRequest :: MonadSnap m => (Request -> Request) -> m ()

    snap-core Snap.Core

    Modifies the Request object stored in a Snap monad. Example:

    ghci> :set -XOverloadedStrings
    ghci> import qualified Data.Map as M
    ghci> import qualified Snap.Test as T
    ghci> let r = T.get "/foo/bar" M.empty
    ghci> r' <- T.buildRequest $ T.get "/bar/foo" M.empty
    ghci> T.runHandler r (modifyRequest (const r') >> getsRequest rqURI >>= writeBS)
    HTTP/1.1 200 OK
    server: Snap/test
    date: Wed, 06 Aug 2014 15:24:25 GMT
    
    /bar/foo
    

  9. putRequest :: MonadSnap m => Request -> m ()

    snap-core Snap.Core

    Puts a new Request object into the Snap monad. Example:

    ghci> :set -XOverloadedStrings
    ghci> import qualified Data.Map as M
    ghci> import qualified Snap.Test as T
    ghci> :{
    ghci| let hndlr = do rq <- T.buildRequest (T.get "/bar/foo" M.empty)
    ghci|                putRequest rq
    ghci|                uri' <- getsRequest rqURI
    ghci|                writeBS uri'
    ghci| :}
    ghci> T.runHandler (T.get "/foo/bar" M.empty) hndlr
    HTTP/1.1 200 OK
    server: Snap/test
    date: Wed, 06 Aug 2014 15:13:46 GMT
    
    /bar/foo
    

  10. readRequestBody :: MonadSnap m => Word64 -> m ByteString

    snap-core Snap.Core

    Returns the request body as a lazy bytestring. /Note that the request is not actually provided lazily!/ Example:

    ghci> :set -XOverloadedStrings
    ghci> import qualified Data.Map as M
    ghci> import qualified Snap.Test as T
    ghci> let r = T.put "/foo" "text/plain" "some text"
    ghci> T.runHandler r (readRequestBody 2048 >>= writeLBS)
    HTTP/1.1 200 OK
    server: Snap/test
    date: Thu, 07 Aug 2014 20:08:44 GMT
    
    some text
    
    Since: 0.6

Page 322 of many | Previous | Next