Safe Haskell | None |
---|---|
Language | GHC2021 |
Provides types for typical IO processes.
Synopsis
- newtype Stderr = MkStderr {}
- data CommandResult
- data ReadHandleResult
- readHandleResultToStderr :: ReadHandleResult -> Stderr
- readHandle :: (HasCallStack, MonadCatch m, MonadHandleReader m) => Int -> Handle -> m ReadHandleResult
Documentation
Newtype wrapper for stderr.
data CommandResult Source #
Result of running a command.
Instances
Show CommandResult Source # | |
Defined in Shrun.IO.Types showsPrec :: Int -> CommandResult -> ShowS # show :: CommandResult -> String # showList :: [CommandResult] -> ShowS # | |
Eq CommandResult Source # | |
Defined in Shrun.IO.Types (==) :: CommandResult -> CommandResult -> Bool # (/=) :: CommandResult -> CommandResult -> Bool # |
data ReadHandleResult Source #
Result from reading a handle. The ordering is based on:
ReadErr
_ <ReadNoData
<ReadSuccess
The Semigroup
instance is based on this ordering, taking the greatest
element. For identical constructors, the left argument is taken.
ReadErr (List UnlinedText) | Error encountered while trying to read a handle. |
ReadSuccess (List UnlinedText) | Successfully read data from the handle. |
ReadNoData | Successfully read no data from the handle. |
Instances
Monoid ReadHandleResult Source # | |
Defined in Shrun.IO.Types | |
Semigroup ReadHandleResult Source # | |
Defined in Shrun.IO.Types (<>) :: ReadHandleResult -> ReadHandleResult -> ReadHandleResult # sconcat :: NonEmpty ReadHandleResult -> ReadHandleResult # stimes :: Integral b => b -> ReadHandleResult -> ReadHandleResult # | |
Show ReadHandleResult Source # | |
Defined in Shrun.IO.Types showsPrec :: Int -> ReadHandleResult -> ShowS # show :: ReadHandleResult -> String # showList :: [ReadHandleResult] -> ShowS # | |
Eq ReadHandleResult Source # | |
Defined in Shrun.IO.Types (==) :: ReadHandleResult -> ReadHandleResult -> Bool # (/=) :: ReadHandleResult -> ReadHandleResult -> Bool # |
readHandleResultToStderr :: ReadHandleResult -> Stderr Source #
Turns a ReadHandleResult
into a Stderr
.
readHandle :: (HasCallStack, MonadCatch m, MonadHandleReader m) => Int -> Handle -> m ReadHandleResult Source #
Attempts to read from the handle.