hsdev-0.1.2.1: Haskell development library and tool with support of autocompletion, symbol info, go to declaration, find references etc.

Safe HaskellNone
LanguageHaskell98

HsDev.Util

Contents

Synopsis

Documentation

directoryContents :: FilePath -> IO [FilePath] Source

Get directory contents safely

traverseDirectory :: FilePath -> IO [FilePath] Source

Collect all file names in directory recursively

isParent :: FilePath -> FilePath -> Bool Source

Is one path parent of another

haskellSource :: FilePath -> Bool Source

Is haskell source?

cabalFile :: FilePath -> Bool Source

Is cabal file?

String utils

tab :: Int -> String -> String Source

Add N tabs to line

tabs :: Int -> String -> String Source

Add N tabs to multiline

trim :: String -> String Source

Trim string

split :: (a -> Bool) -> [a] -> [[a]] Source

Split list

Helper

(.::) :: FromJSON a => HashMap Text Value -> Text -> Parser a Source

Workaround, sometimes we get HM.lookup "foo" v == Nothing, but lookup "foo" (HM.toList v) == Just smth

objectUnion :: Value -> Value -> Value Source

Union two JSON objects

Exceptions

liftException :: MonadCatchIO m => m a -> ErrorT String m a Source

Lift IO exception to ErrorT

liftExceptionM :: (MonadCatchIO m, Error e, MonadError e m) => m a -> m a Source

Lift IO exception to MonadError

liftIOErrors :: MonadCatchIO m => ErrorT String m a -> ErrorT String m a Source

Lift IO exceptions to ErrorT

eitherT :: (Monad m, Error e, MonadError e m) => Either String a -> m a Source

UTF-8

IO

logException :: String -> (String -> IO ()) -> IO () -> IO () Source

logIO :: String -> (String -> IO ()) -> IO () -> IO () Source

ignoreIO :: IO () -> IO () Source