Extra-1.46: A grab bag of modules.

Safe HaskellNone

Extra.Misc

Contents

Synopsis

String functions

columns :: [[String]] -> [[String]]Source

Pad strings so the columns line up. The argument and return value elements are the rows of a table. Do not pad the rightmost column.

justify :: String -> Int -> [[String]]Source

Group words into lines of length n or less.

Tuple functions

mapSnd :: (b -> c) -> (a, b) -> (a, c)Source

FilePath functions

canon :: FilePath -> FilePathSource

Weak attempt at canonicalizing a file path.

Map and Set functions

listMap :: Ord k => [(k, a)] -> Map k [a]Source

Turn a list of (k, a) pairs into a map from k -> [a]. The order of the elements in the a list is preserved.

listDiff :: Ord a => [a] -> [a] -> [a]Source

System.Posix

md5sum :: FilePath -> IO StringSource

Deprecated: Use Data.ByteString.Lazy.Char8.readFile path >>= return . show . Data.Digest.Pure.MD5.md5

Run md5sum on a file and return the resulting checksum as text.

sameInode :: FilePath -> FilePath -> IO BoolSource

Predicate to decide if two files have the same inode.

sameMd5sum :: FilePath -> FilePath -> IO BoolSource

Predicate to decide if two files have the same md5 checksum.

tarDir :: FilePath -> IO (Maybe String)Source

Given a tarball, return the name of the top directory.

Processes

ByteString

cd :: FilePath -> IO a -> IO aSource

Debugging

read' :: Read a => String -> aSource

A version of read with a more helpful error message.