License | GPL-3.0-or-later |
---|---|
Safe Haskell | None |
Language | Haskell2010 |
Copyright: Oleg Grenrus
Synopsis
- class (HasOptions r, MonadReader r m, MonadError Error m) => MonadCabalFmt r m | m -> r where
- listDirectory :: FilePath -> m [FilePath]
- doesDirectoryExist :: FilePath -> m Bool
- readFileBS :: FilePath -> m Contents
- displayWarning :: String -> m ()
- getFiles :: MonadCabalFmt r m => FilePath -> m [FilePath]
- data Contents
- data CabalFmt a
- runCabalFmt :: Map FilePath ByteString -> Options -> CabalFmt a -> Either Error (a, [String])
- data CabalFmtIO a
- runCabalFmtIO :: Maybe FilePath -> Options -> CabalFmtIO a -> IO (Either Error a)
Monad class
class (HasOptions r, MonadReader r m, MonadError Error m) => MonadCabalFmt r m | m -> r where Source #
listDirectory :: FilePath -> m [FilePath] Source #
doesDirectoryExist :: FilePath -> m Bool Source #
readFileBS :: FilePath -> m Contents Source #
displayWarning :: String -> m () Source #
Instances
MonadCabalFmt Options CabalFmt Source # | |
Defined in CabalFmt.Monad |
Pure implementation
Pure MonadCabalFmt
.
listDirectory
always return empty list.
Instances
Monad CabalFmt Source # | |
Functor CabalFmt Source # | |
Applicative CabalFmt Source # | |
MonadReader Options CabalFmt Source # | |
MonadError Error CabalFmt Source # | |
Defined in CabalFmt.Monad throwError :: Error -> CabalFmt a # catchError :: CabalFmt a -> (Error -> CabalFmt a) -> CabalFmt a # | |
MonadCabalFmt Options CabalFmt Source # | |
Defined in CabalFmt.Monad |
runCabalFmt :: Map FilePath ByteString -> Options -> CabalFmt a -> Either Error (a, [String]) Source #
IO implementation
data CabalFmtIO a Source #
Instances
Monad CabalFmtIO Source # | |
Defined in CabalFmt.Monad (>>=) :: CabalFmtIO a -> (a -> CabalFmtIO b) -> CabalFmtIO b # (>>) :: CabalFmtIO a -> CabalFmtIO b -> CabalFmtIO b # return :: a -> CabalFmtIO a # fail :: String -> CabalFmtIO a # | |
Functor CabalFmtIO Source # | |
Defined in CabalFmt.Monad fmap :: (a -> b) -> CabalFmtIO a -> CabalFmtIO b # (<$) :: a -> CabalFmtIO b -> CabalFmtIO a # | |
Applicative CabalFmtIO Source # | |
Defined in CabalFmt.Monad pure :: a -> CabalFmtIO a # (<*>) :: CabalFmtIO (a -> b) -> CabalFmtIO a -> CabalFmtIO b # liftA2 :: (a -> b -> c) -> CabalFmtIO a -> CabalFmtIO b -> CabalFmtIO c # (*>) :: CabalFmtIO a -> CabalFmtIO b -> CabalFmtIO b # (<*) :: CabalFmtIO a -> CabalFmtIO b -> CabalFmtIO a # | |
MonadIO CabalFmtIO Source # | |
Defined in CabalFmt.Monad liftIO :: IO a -> CabalFmtIO a # | |
MonadError Error CabalFmtIO Source # | |
Defined in CabalFmt.Monad throwError :: Error -> CabalFmtIO a # catchError :: CabalFmtIO a -> (Error -> CabalFmtIO a) -> CabalFmtIO a # |
runCabalFmtIO :: Maybe FilePath -> Options -> CabalFmtIO a -> IO (Either Error a) Source #