Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- formatDecimal :: RealFloat a => Int -> Bool -> a -> Text
- formatInt :: RealFrac a => a -> Text
- showT :: Show a => a -> Text
- showBS :: Show a => a -> ByteString
- collect :: Ord b => [a] -> (a -> b) -> (a -> c) -> Map b [c]
- noDots :: Text -> Text
- encodeCompress :: SafeCopy a => a -> ByteString
- decodeCompress :: (SafeCopy a, Serialize a) => ByteString -> Either String a
- indefinitely :: String -> Int -> IO () -> IO ()
- seconds :: Int -> Int
- milliseconds :: Int -> Int
- for :: Functor f => f a -> (a -> b) -> f b
Documentation
showBS :: Show a => a -> ByteString Source #
encodeCompress :: SafeCopy a => a -> ByteString Source #
Serialize and compress with GZip in that order. This is the only function we use for serializing to Redis.
decodeCompress :: (SafeCopy a, Serialize a) => ByteString -> Either String a Source #
Decompress from GZip and deserialize in that order. Tries to decode SafeCopy first and falls back to Serialize if that fails to account for old data. Note that encodeCompress only serializes to SafeCopy so writes will be updated.
indefinitely :: String -> Int -> IO () -> IO () Source #
Run an IO repeatedly with the given delay in microseconds. If there are exceptions in the inner loop, they are logged to stderr, prefixed with the given string context and retried at an exponential backoff capped at 60 seconds between.
milliseconds :: Int -> Int Source #
Convert milliseconds to microseconds