charon-0.1: Template
Safe HaskellSafe-Inferred
LanguageGHC2021

Charon.Runner.CharonT

Description

Provides the CharonT type for running Charon.

Synopsis

Documentation

newtype CharonT env m a Source #

CharonT is the main application type that runs shell commands.

Constructors

MkCharonT (ReaderT env m a) 

Instances

Instances details
Monad m => MonadReader env (CharonT env m) Source # 
Instance details

Defined in Charon.Runner.CharonT

Methods

ask :: CharonT env m env #

local :: (env -> env) -> CharonT env m a -> CharonT env m a #

reader :: (env -> a) -> CharonT env m a #

MonadIO m => MonadIO (CharonT env m) Source # 
Instance details

Defined in Charon.Runner.CharonT

Methods

liftIO :: IO a -> CharonT env m a #

Applicative m => Applicative (CharonT env m) Source # 
Instance details

Defined in Charon.Runner.CharonT

Methods

pure :: a -> CharonT env m a #

(<*>) :: CharonT env m (a -> b) -> CharonT env m a -> CharonT env m b #

liftA2 :: (a -> b -> c) -> CharonT env m a -> CharonT env m b -> CharonT env m c #

(*>) :: CharonT env m a -> CharonT env m b -> CharonT env m b #

(<*) :: CharonT env m a -> CharonT env m b -> CharonT env m a #

Functor m => Functor (CharonT env m) Source # 
Instance details

Defined in Charon.Runner.CharonT

Methods

fmap :: (a -> b) -> CharonT env m a -> CharonT env m b #

(<$) :: a -> CharonT env m b -> CharonT env m a #

Monad m => Monad (CharonT env m) Source # 
Instance details

Defined in Charon.Runner.CharonT

Methods

(>>=) :: CharonT env m a -> (a -> CharonT env m b) -> CharonT env m b #

(>>) :: CharonT env m a -> CharonT env m b -> CharonT env m b #

return :: a -> CharonT env m a #

MonadAsync m => MonadAsync (CharonT env m) Source # 
Instance details

Defined in Charon.Runner.CharonT

Methods

withAsync :: HasCallStack => CharonT env m a -> (Async a -> CharonT env m b) -> CharonT env m b Source #

withAsyncBound :: HasCallStack => CharonT env m a -> (Async a -> CharonT env m b) -> CharonT env m b Source #

withAsyncOn :: HasCallStack => Int -> CharonT env m a -> (Async a -> CharonT env m b) -> CharonT env m b Source #

withAsyncWithUnmask :: HasCallStack => ((forall c. CharonT env m c -> CharonT env m c) -> CharonT env m a) -> (Async a -> CharonT env m b) -> CharonT env m b Source #

withAsyncOnWithUnmask :: HasCallStack => Int -> ((forall c. CharonT env m c -> CharonT env m c) -> CharonT env m a) -> (Async a -> CharonT env m b) -> CharonT env m b Source #

wait :: HasCallStack => Async a -> CharonT env m a Source #

poll :: HasCallStack => Async a -> CharonT env m (Maybe (Either SomeException a)) Source #

waitCatch :: HasCallStack => Async a -> CharonT env m (Either SomeException a) Source #

cancel :: HasCallStack => Async a -> CharonT env m () Source #

uninterruptibleCancel :: HasCallStack => Async a -> CharonT env m () Source #

cancelWith :: (Exception e, HasCallStack) => Async a -> e -> CharonT env m () Source #

race :: HasCallStack => CharonT env m a -> CharonT env m b -> CharonT env m (Either a b) Source #

concurrently :: HasCallStack => CharonT env m a -> CharonT env m b -> CharonT env m (a, b) Source #

concurrently_ :: HasCallStack => CharonT env m a -> CharonT env m b -> CharonT env m () Source #

waitAny :: HasCallStack => [Async a] -> CharonT env m (Async a, a) Source #

waitAnyCatch :: HasCallStack => [Async a] -> CharonT env m (Async a, Either SomeException a) Source #

waitAnyCancel :: HasCallStack => [Async a] -> CharonT env m (Async a, a) Source #

waitAnyCatchCancel :: HasCallStack => [Async a] -> CharonT env m (Async a, Either SomeException a) Source #

waitEither :: HasCallStack => Async a -> Async b -> CharonT env m (Either a b) Source #

waitEitherCatch :: HasCallStack => Async a -> Async b -> CharonT env m (Either (Either SomeException a) (Either SomeException b)) Source #

waitEitherCancel :: HasCallStack => Async a -> Async b -> CharonT env m (Either a b) Source #

waitEitherCatchCancel :: HasCallStack => Async a -> Async b -> CharonT env m (Either (Either SomeException a) (Either SomeException b)) Source #

waitEither_ :: HasCallStack => Async a -> Async b -> CharonT env m () Source #

waitBoth :: HasCallStack => Async a -> Async b -> CharonT env m (a, b) Source #

async :: HasCallStack => CharonT env m a -> CharonT env m (Async a) Source #

asyncBound :: HasCallStack => CharonT env m a -> CharonT env m (Async a) Source #

asyncOn :: HasCallStack => Int -> CharonT env m a -> CharonT env m (Async a) Source #

asyncWithUnmask :: HasCallStack => ((forall b. CharonT env m b -> CharonT env m b) -> CharonT env m a) -> CharonT env m (Async a) Source #

asyncOnWithUnmask :: HasCallStack => Int -> ((forall b. CharonT env m b -> CharonT env m b) -> CharonT env m a) -> CharonT env m (Async a) Source #

link :: HasCallStack => Async a -> CharonT env m () Source #

linkOnly :: HasCallStack => (SomeException -> Bool) -> Async a -> CharonT env m () Source #

link2 :: HasCallStack => Async a -> Async b -> CharonT env m () Source #

link2Only :: HasCallStack => (SomeException -> Bool) -> Async a -> Async b -> CharonT env m () Source #

pooledMapConcurrentlyN :: (HasCallStack, Traversable t) => Positive Int -> (a -> CharonT env m b) -> t a -> CharonT env m (t b) Source #

pooledMapConcurrently :: (HasCallStack, Traversable t) => (a -> CharonT env m b) -> t a -> CharonT env m (t b) Source #

pooledMapConcurrentlyN_ :: (Foldable f, HasCallStack) => Positive Int -> (a -> CharonT env m b) -> f a -> CharonT env m () Source #

pooledMapConcurrently_ :: (Foldable f, HasCallStack) => (a -> CharonT env m b) -> f a -> CharonT env m () Source #

MonadFileReader m => MonadFileReader (CharonT env m) Source # 
Instance details

Defined in Charon.Runner.CharonT

MonadFileWriter m => MonadFileWriter (CharonT env m) Source # 
Instance details

Defined in Charon.Runner.CharonT

MonadHandleWriter m => MonadHandleWriter (CharonT env m) Source # 
Instance details

Defined in Charon.Runner.CharonT

MonadPathReader m => MonadPathReader (CharonT env m) Source # 
Instance details

Defined in Charon.Runner.CharonT

Methods

listDirectory :: OsPath -> CharonT env m [OsPath] Source #

getDirectoryContents :: OsPath -> CharonT env m [OsPath] Source #

getCurrentDirectory :: CharonT env m OsPath Source #

getHomeDirectory :: CharonT env m OsPath Source #

getXdgDirectory :: XdgDirectory -> OsPath -> CharonT env m OsPath Source #

getXdgDirectoryList :: XdgDirectoryList -> CharonT env m [OsPath] Source #

getAppUserDataDirectory :: OsPath -> CharonT env m OsPath Source #

getUserDocumentsDirectory :: CharonT env m OsPath Source #

getTemporaryDirectory :: CharonT env m OsPath Source #

getFileSize :: OsPath -> CharonT env m Integer Source #

canonicalizePath :: OsPath -> CharonT env m OsPath Source #

makeAbsolute :: OsPath -> CharonT env m OsPath Source #

makeRelativeToCurrentDirectory :: OsPath -> CharonT env m OsPath Source #

doesPathExist :: OsPath -> CharonT env m Bool Source #

doesFileExist :: OsPath -> CharonT env m Bool Source #

doesDirectoryExist :: OsPath -> CharonT env m Bool Source #

findExecutable :: OsPath -> CharonT env m (Maybe OsPath) Source #

findExecutables :: OsPath -> CharonT env m [OsPath] Source #

findExecutablesInDirectories :: [OsPath] -> OsPath -> CharonT env m [OsPath] Source #

findFileWith :: (OsPath -> CharonT env m Bool) -> [OsPath] -> OsPath -> CharonT env m (Maybe OsPath) Source #

findFilesWith :: (OsPath -> CharonT env m Bool) -> [OsPath] -> OsPath -> CharonT env m [OsPath] Source #

pathIsSymbolicLink :: OsPath -> CharonT env m Bool Source #

getSymbolicLinkTarget :: OsPath -> CharonT env m OsPath Source #

getPermissions :: OsPath -> CharonT env m Permissions Source #

getAccessTime :: OsPath -> CharonT env m UTCTime Source #

getModificationTime :: OsPath -> CharonT env m UTCTime Source #

MonadPathWriter m => MonadPathWriter (CharonT env m) Source # 
Instance details

Defined in Charon.Runner.CharonT

MonadIORef m => MonadIORef (CharonT env m) Source # 
Instance details

Defined in Charon.Runner.CharonT

Methods

newIORef :: HasCallStack => a -> CharonT env m (IORef a) Source #

readIORef :: HasCallStack => IORef a -> CharonT env m a Source #

writeIORef :: HasCallStack => IORef a -> a -> CharonT env m () Source #

atomicWriteIORef :: HasCallStack => IORef a -> a -> CharonT env m () Source #

modifyIORef' :: HasCallStack => IORef a -> (a -> a) -> CharonT env m () Source #

atomicModifyIORef' :: HasCallStack => IORef a -> (a -> (a, b)) -> CharonT env m b Source #

(MonadHandleWriter m, MonadTime m) => MonadLoggerNS (CharonT (Env m) m) Source # 
Instance details

Defined in Charon.Runner.CharonT

MonadTerminal m => MonadTerminal (CharonT env m) Source # 
Instance details

Defined in Charon.Runner.CharonT

MonadTime m => MonadTime (CharonT env m) Source # 
Instance details

Defined in Charon.Runner.CharonT

MonadPosixCompat m => MonadPosixCompat (CharonT env m) Source # 
Instance details

Defined in Charon.Runner.CharonT

Methods

setFileMode :: FilePath -> FileMode -> CharonT env m () Source #

setFdMode :: Fd -> FileMode -> CharonT env m () Source #

setFileCreationMask :: FileMode -> CharonT env m FileMode Source #

fileAccess :: FilePath -> Bool -> Bool -> Bool -> CharonT env m Bool Source #

fileExist :: FilePath -> CharonT env m Bool Source #

getFileStatus :: FilePath -> CharonT env m FileStatus Source #

getFdStatus :: Fd -> CharonT env m FileStatus Source #

getSymbolicLinkStatus :: FilePath -> CharonT env m FileStatus Source #

createNamedPipe :: FilePath -> FileMode -> CharonT env m () Source #

createDevice :: FilePath -> FileMode -> DeviceID -> CharonT env m () Source #

createLink :: FilePath -> FilePath -> CharonT env m () Source #

removeLink :: FilePath -> CharonT env m () Source #

createSymbolicLink :: FilePath -> FilePath -> CharonT env m () Source #

readSymbolicLink :: FilePath -> CharonT env m FilePath Source #

rename :: FilePath -> FilePath -> CharonT env m () Source #

setOwnerAndGroup :: FilePath -> UserID -> GroupID -> CharonT env m () Source #

setFdOwnerAndGroup :: Fd -> UserID -> GroupID -> CharonT env m () Source #

setSymbolicLinkOwnerAndGroup :: FilePath -> UserID -> GroupID -> CharonT env m () Source #

setFileTimes :: FilePath -> EpochTime -> EpochTime -> CharonT env m () Source #

touchFile :: FilePath -> CharonT env m () Source #

setFileSize :: FilePath -> FileOffset -> CharonT env m () Source #

setFdSize :: Fd -> FileOffset -> CharonT env m () Source #

getPathVar :: FilePath -> PathVar -> CharonT env m Limit Source #

getFdPathVar :: Fd -> PathVar -> CharonT env m Limit Source #

MonadCatch m => MonadCatch (CharonT env m) Source # 
Instance details

Defined in Charon.Runner.CharonT

Methods

catch :: (HasCallStack, Exception e) => CharonT env m a -> (e -> CharonT env m a) -> CharonT env m a #

MonadMask m => MonadMask (CharonT env m) Source # 
Instance details

Defined in Charon.Runner.CharonT

Methods

mask :: HasCallStack => ((forall a. CharonT env m a -> CharonT env m a) -> CharonT env m b) -> CharonT env m b #

uninterruptibleMask :: HasCallStack => ((forall a. CharonT env m a -> CharonT env m a) -> CharonT env m b) -> CharonT env m b #

generalBracket :: HasCallStack => CharonT env m a -> (a -> ExitCase b -> CharonT env m c) -> (a -> CharonT env m b) -> CharonT env m (b, c) #

MonadThrow m => MonadThrow (CharonT env m) Source # 
Instance details

Defined in Charon.Runner.CharonT

Methods

throwM :: (HasCallStack, Exception e) => e -> CharonT env m a #

(MonadHandleWriter m, MonadTime m) => MonadLogger (CharonT (Env m) m) Source # 
Instance details

Defined in Charon.Runner.CharonT

Methods

monadLoggerLog :: ToLogStr msg => Loc -> LogSource -> LogLevel -> msg -> CharonT (Env m) m () Source #

runCharonT :: CharonT env m a -> env -> m a Source #

Runs a CharonT with the given env.

usingCharonT :: env -> CharonT env m a -> m a Source #

Flipped runCharonT