Hoogle Search

Within LTS Haskell 24.46 (ghc-9.10.3)

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

  1. setHandlers :: LogHandler a => [a] -> Logger -> Logger

    hslogger System.Log.Logger

    Set the Logger's list of handlers to the list supplied. All existing handlers are removed first.

  2. setLevel :: Priority -> Logger -> Logger

    hslogger System.Log.Logger

    Sets the "level" of the Logger. Returns a new Logger object with the new level.

  3. setElem :: a -> (Int, Int) -> Matrix a -> Matrix a

    matrix Data.Matrix

    Replace the value of a cell in a matrix.

  4. setSize :: a -> Int -> Int -> Matrix a -> Matrix a

    matrix Data.Matrix

    Set the size of a matrix to given parameters. Use a default element for undefined entries if the matrix has been extended.

  5. setContentLength :: Word64 -> Response -> Response

    snap-core Snap.Core

    A note here: if you want to set the Content-Length for the response, Snap forces you to do it with this function rather than by setting it in the headers; the Content-Length in the headers will be ignored. The reason for this is that Snap needs to look up the value of Content-Length for each request, and looking the string value up in the headers and parsing the number out of the text will be too expensive. If you don't set a content length in your response, HTTP keep-alive will be disabled for HTTP/1.0 clients, forcing a Connection: close. For HTTP/1.1 clients, Snap will switch to the chunked transfer encoding if Content-Length is not specified. Example:

    ghci> setContentLength 400 emptyResponse
    HTTP/1.1 200 OK
    Content-Length: 400
    

  6. setContentType :: ByteString -> Response -> Response

    snap-core Snap.Core

    Sets the Content-Type in the Response headers. Example:

    ghci> :set -XOverloadedStrings
    ghci> setContentType "text/html" emptyResponse
    HTTP/1.1 200 OK
    content-type: text/html
    

  7. setHeader :: HasHeaders a => CI ByteString -> ByteString -> a -> a

    snap-core Snap.Core

    Sets a header key-value-pair in a HasHeaders datatype. If a header with the same name already exists, it is overwritten with the new value. Example:

    ghci> import qualified Snap.Types.Headers as H
    ghci> setHeader "Host" "localhost" H.empty
    H {unH = [("host","localhost")]}
    ghci> setHeader "Host" "127.0.0.1" it
    H {unH = [("host","127.0.0.1")]}
    

  8. setResponseBody :: (OutputStream Builder -> IO (OutputStream Builder)) -> Response -> Response

    snap-core Snap.Core

    Sets an HTTP response body to the given stream procedure. Example:

    ghci> :set -XOverloadedStrings
    ghci> import qualified System.IO.Streams as Streams
    ghci> import qualified Data.ByteString.Builder as Builder
    ghci> :{
    ghci| let r = setResponseBody
    ghci|         (out -> do
    ghci|             Streams.write (Just $ Builder.byteString "Hello, world!") out
    ghci|             return out)
    ghci|         emptyResponse
    ghci| :}
    ghci> r
    HTTP/1.1 200 OK
    
    Hello, world!
    

  9. setResponseCode :: Int -> Response -> Response

    snap-core Snap.Core

    Sets the HTTP response code. Example:

    ghci> setResponseCode 404 emptyResponse
    HTTP/1.1 404 Not Found
    

  10. setResponseStatus :: Int -> ByteString -> Response -> Response

    snap-core Snap.Core

    Sets the HTTP response status. Note: normally you would use setResponseCode unless you needed a custom response explanation. Example:

    ghci> :set -XOverloadedStrings
    ghci> setResponseStatus 500 "Internal Server Error" emptyResponse
    HTTP/1.1 500 Internal Server Error
    

Page 301 of many | Previous | Next