HAppS-Util-0.9.2.1: Web frameworkContentsIndex
HAppS.Util.Common
Description
Various helper routines.
Synopsis
type Seconds = Int
type EpochSeconds = Int64
epochSeconds :: CalendarTime -> EpochSeconds
eSecsToCalTime :: EpochSeconds -> IO CalendarTime
epochPico :: CalendarTime -> Integer
hPutLine :: Handle -> String -> IO ()
hGetLn :: Handle -> IO String
ltrim :: String -> String
rtrim :: String -> String
trim :: String -> String
unBracket :: String -> String
splitList :: Eq a => a -> [a] -> [[a]]
splitListBy :: (a -> Bool) -> [a] -> [[a]]
split :: (a -> Bool) -> [a] -> ([a], [a])
mbReadFile :: a -> (String -> a) -> FilePath -> IO a
mapFst :: (a -> b) -> [(a, x)] -> [(b, x)]
mapSnd :: (a -> b) -> [(x, a)] -> [(x, b)]
revmap :: a -> [a -> b] -> [b]
comp :: Ord t => (a -> t) -> a -> a -> Ordering
runCommand :: String -> [String] -> IO ()
debug :: Show a => String -> a -> a
debugM :: Monad m => String -> m ()
readM :: (Monad m, Read t) => String -> m t
maybeM :: Monad m => Maybe a -> m a
notMb :: a -> Maybe a -> Maybe a
Documentation
type Seconds = Int
type EpochSeconds = Int64
epochSeconds :: CalendarTime -> EpochSeconds
eSecsToCalTime :: EpochSeconds -> IO CalendarTime
epochPico :: CalendarTime -> Integer
hPutLine :: Handle -> String -> IO ()
Put a line into a handle followed by rn and echo to stdout
hGetLn :: Handle -> IO String
Get a line from the handle and echo to stdout
ltrim :: String -> String
rtrim :: String -> String
trim :: String -> String
unBracket :: String -> String
splitList :: Eq a => a -> [a] -> [[a]]
splitListBy :: (a -> Bool) -> [a] -> [[a]]
split :: (a -> Bool) -> [a] -> ([a], [a])
Split is like break, but the matching element is dropped.
mbReadFile :: a -> (String -> a) -> FilePath -> IO a
Read file with a default value if the file does not exist.
mapFst :: (a -> b) -> [(a, x)] -> [(b, x)]
mapSnd :: (a -> b) -> [(x, a)] -> [(x, b)]
revmap :: a -> [a -> b] -> [b]
comp :: Ord t => (a -> t) -> a -> a -> Ordering
runCommand :: String -> [String] -> IO ()
Run an external command. Upon failure print status to stderr.
debug :: Show a => String -> a -> a
Unsafe tracing, outputs the message and the value to stderr.
debugM :: Monad m => String -> m ()
Unsafe tracing messages inside a monad.
readM :: (Monad m, Read t) => String -> m t
Read in any monad.
maybeM :: Monad m => Maybe a -> m a
Convert Maybe into an another monad.
notMb :: a -> Maybe a -> Maybe a
Produced by Haddock version 2.1.0