Hoogle Search

Within LTS Haskell 24.33 (ghc-9.10.3)

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

  1. readDouble :: String -> Maybe Double

    basement Basement.String

    Try to read a Double

  2. readFloatingExact :: String -> ReadFloatingCallback a -> Maybe a

    basement Basement.String

    Read an Floating like number of the form:

    Call a function with:
    • A boolean representing if the number is negative
    • The digits part represented as a single natural number (123.456 is represented as 123456)
    • The number of digits in the fractional part (e.g. 123.456 => 3)
    • The exponent if any
    The code is structured as a simple state machine that:
    • Optionally Consume a - sign
    • Consume number for the integral part
    • Optionally
    • Consume .
    • Consume remaining digits if not already end of string
    • Optionally Consume a e or E follow by an optional - and a number

  3. readInteger :: String -> Maybe Integer

    basement Basement.String

    No documentation available.

  4. readIntegral :: (HasNegation i, IntegralUpsize Word8 i, Additive i, Multiplicative i, IsIntegral i) => String -> Maybe i

    basement Basement.String

    Read an Integer from a String Consume an optional minus sign and many digits until end of string.

  5. readNatural :: String -> Maybe Natural

    basement Basement.String

    Read a Natural from a String Consume many digits until end of string.

  6. readRational :: String -> Maybe Rational

    basement Basement.String

    Try to read a floating number as a Rational Note that for safety reason, only exponent between -10000 and 10000 is allowed as otherwise DoS/OOM is very likely. if you don't want this behavior, switching to a scientific type (not provided yet) that represent the exponent separately is the advised solution.

  7. readCookie :: (MonadSnap m, Readable a) => ByteString -> m a

    snap-core Snap.Core

    Gets the HTTP Cookie with the specified name and decodes it. If the decoding fails, the handler calls pass. Example:

    ghci> :set -XOverloadedStrings
    ghci> import qualified Data.Map as M
    ghci> import qualified Snap.Test as T
    ghci> let cookie = Cookie "name" "value" Nothing Nothing Nothing False False
    ghci> let r = T.get "/foo/bar" M.empty >> T.addCookies [cookie]
    ghci> T.runHandler r (readCookie "name" >>= writeBS)
    HTTP/1.1 200 OK
    server: Snap/test
    date: Thu, 07 Aug 2014 12:20:09 GMT
    
    value
    

  8. 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

  9. readCookie :: (MonadSnap m, Readable a) => ByteString -> m a

    snap-core Snap.Internal.Core

    Gets the HTTP Cookie with the specified name and decodes it. If the decoding fails, the handler calls pass. Example:

    ghci> :set -XOverloadedStrings
    ghci> import qualified Data.Map as M
    ghci> import qualified Snap.Test as T
    ghci> let cookie = Cookie "name" "value" Nothing Nothing Nothing False False
    ghci> let r = T.get "/foo/bar" M.empty >> T.addCookies [cookie]
    ghci> T.runHandler r (readCookie "name" >>= writeBS)
    HTTP/1.1 200 OK
    server: Snap/test
    date: Thu, 07 Aug 2014 12:20:09 GMT
    
    value
    

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

    snap-core Snap.Internal.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 133 of many | Previous | Next