Safe Haskell | None |
---|---|
Language | Haskell98 |
- withCurrentDirectory :: FilePath -> IO a -> IO a
- directoryContents :: FilePath -> IO [FilePath]
- traverseDirectory :: FilePath -> IO [FilePath]
- searchPath :: (MonadIO m, MonadPlus m) => FilePath -> (FilePath -> m a) -> m a
- isParent :: FilePath -> FilePath -> Bool
- haskellSource :: FilePath -> Bool
- cabalFile :: FilePath -> Bool
- tab :: Int -> String -> String
- tabs :: Int -> String -> String
- trim :: String -> String
- split :: (a -> Bool) -> [a] -> [[a]]
- (.::) :: FromJSON a => HashMap Text Value -> Text -> Parser a
- (.::?) :: FromJSON a => HashMap Text Value -> Text -> Parser (Maybe a)
- objectUnion :: Value -> Value -> Value
- liftException :: MonadCatch m => m a -> ErrorT String m a
- liftExceptionM :: (MonadCatch m, Error e, MonadError e m) => m a -> m a
- liftIOErrors :: MonadCatch m => ErrorT String m a -> ErrorT String m a
- eitherT :: (Monad m, Error e, MonadError e m) => Either String a -> m a
- fromUtf8 :: ByteString -> String
- toUtf8 :: String -> ByteString
- hGetLineBS :: Handle -> IO ByteString
- logException :: String -> (String -> IO ()) -> IO () -> IO ()
- logIO :: String -> (String -> IO ()) -> IO () -> IO ()
- ignoreIO :: IO () -> IO ()
- liftTask :: MonadIO m => IO (Task a) -> ErrorT String m a
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
haskellSource :: FilePath -> Bool Source
Is haskell source?
String utils
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
UTF-8
fromUtf8 :: ByteString -> String Source
toUtf8 :: String -> ByteString Source
IO
hGetLineBS :: Handle -> IO ByteString Source