hsdev-0.1.3.2: 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

withCurrentDirectory :: FilePath -> IO a -> IO a Source

Run action with current directory set

directoryContents :: FilePath -> IO [FilePath] Source

Get directory contents safely

traverseDirectory :: FilePath -> IO [FilePath] Source

Collect all file names in directory recursively

searchPath :: (MonadIO m, MonadPlus m) => FilePath -> (FilePath -> m a) -> m a Source

Search something up

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 :: MonadCatch m => m a -> ErrorT String m a Source

Lift IO exception to ErrorT

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

Lift IO exception to MonadError

liftIOErrors :: MonadCatch 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

Task