Safe Haskell | None |
---|---|
Language | GHC2024 |
Data.Git.Phoenix.Prelude
Synopsis
- module Control.DeepSeq
- module Relude
- module System.Time.Extra
- module Text.Printf
- sourceDirectoryDeep :: forall (m :: Type -> Type) i. MonadResource m => Bool -> FilePath -> ConduitT i FilePath m ()
- concatC :: forall (m :: Type -> Type) mono. (Monad m, MonoFoldable mono) => ConduitT mono (Element mono) m ()
- foldMC :: Monad m => (a -> b -> m a) -> a -> ConduitT b o m a
- mapMC :: Monad m => (a -> m b) -> ConduitT a b m ()
- (.|) :: forall (m :: Type -> Type) a b c r. Monad m => ConduitT a b m () -> ConduitT b c m r -> ConduitT a c m r
- runConduitRes :: MonadUnliftIO m => ConduitT () Void (ResourceT m) r -> m r
- (</>) :: FilePath -> FilePath -> FilePath
- dropFileName :: FilePath -> FilePath
- makeRelative :: FilePath -> FilePath -> FilePath
- splitFileName :: FilePath -> (String, String)
- getNumCapabilities :: IO Int
- (!?) :: [a] -> Int -> Maybe a
- untag :: forall {k} (s :: k) b. Tagged s b -> b
- configReadToken :: MVar ()
- defaultTraceMessageFormat :: TraceMessageFormat
- defaultTraceMessageFormatYaml :: TraceMessageFormatMaybe
- defaultYamlConfig :: YamlConfigMaybe
- emptyPrefixTraceLevel :: TraceLevel -> [LeveledModulePrefix]
- envVarName :: Loc -> EnvironmentVariable -> Maybe DynConfigEnvVar
- getConfig :: Q TraceEmbraceConfig
- getRuntimeConfig :: DynConfigEnvVar -> IO (StrictRadixTree TraceLevel)
- loadRuntimeConfig :: DynConfigEnvVar -> IO (StrictRadixTree TraceLevel)
- loadRuntimeConfigFromYamlFile :: FilePath -> IO [LeveledModulePrefix]
- loadYamlConfig :: IO YamlConfig
- markerConfig :: TraceEmbraceConfig
- mkPrefixTree :: [LeveledModulePrefix] -> StrictRadixTree TraceLevel
- newYamlConfig :: YamlConfigMaybe
- runtimeTraceEmbraceConfigRef :: MVar (LRU DynConfigEnvVar (StrictRadixTree TraceLevel))
- traceAll :: [LeveledModulePrefix]
- traceEmbraceConfigFileName :: FilePath
- traceEmbraceConfigRef :: IORef (Maybe TraceEmbraceConfig)
- unsafeIoSink :: IORef (Maybe Handle)
- validateTraceMessageFormat :: String -> TraceMessageFormatMaybe -> Either String (Refined IdPred TraceMessageFormat)
- validateYamlConfig :: YamlConfigMaybe -> Either String YamlConfig
- yaml2Config :: YamlConfig -> TraceEmbraceConfig
- packageBasedEnvVarPrefix :: String
- charToLevel :: String -> (TraceLevel, String)
- traceLevelToChar :: TraceLevel -> Text
- entrySeparator :: forall (a :: Type -> Type) f. Functor f => (Columnar a SeparatorValidator String -> f (Columnar a SeparatorValidator String)) -> TraceMessageFormatG a -> f (TraceMessageFormatG a)
- keyValueSeparator :: forall (a :: Type -> Type) f. Functor f => (Columnar a SeparatorValidator String -> f (Columnar a SeparatorValidator String)) -> TraceMessageFormatG a -> f (TraceMessageFormatG a)
- retValPrefix :: forall (a :: Type -> Type) f. Functor f => (Columnar a SeparatorValidator String -> f (Columnar a SeparatorValidator String)) -> TraceMessageFormatG a -> f (TraceMessageFormatG a)
- traceLinePattern :: forall (a :: Type -> Type) f. Functor f => (Columnar a NonEmpty [TraceMessageElement] -> f (Columnar a NonEmpty [TraceMessageElement])) -> TraceMessageFormatG a -> f (TraceMessageFormatG a)
- s_ :: Q Pat
- tg :: Q Exp
- tg' :: String -> Q Exp
- tr :: String -> Q Exp
- trFunMarker :: Q Exp
- trIo :: String -> Q Exp
- trIoFunMarker :: Q Exp
- tw :: String -> Q Exp
- tw' :: String -> Q Exp
- u :: Q Exp
- underbar :: Undebar
- copyFile :: MonadIO m => FilePath -> FilePath -> m ()
- createDirectory :: MonadIO m => FilePath -> m ()
- createDirectoryIfMissing :: MonadIO m => Bool -> FilePath -> m ()
- createFileLink :: MonadIO m => FilePath -> FilePath -> m ()
- doesDirectoryExist :: MonadIO m => FilePath -> m Bool
- doesFileExist :: MonadIO m => FilePath -> m Bool
- getSymbolicLinkTarget :: MonadIO m => FilePath -> m FilePath
- listDirectory :: MonadIO m => FilePath -> m [FilePath]
- makeAbsolute :: MonadIO m => FilePath -> m FilePath
- pathIsSymbolicLink :: MonadIO m => FilePath -> m Bool
- removeFile :: MonadIO m => FilePath -> m ()
- bracket :: MonadUnliftIO m => m a -> (a -> m b) -> (a -> m c) -> m c
- bracket_ :: MonadUnliftIO m => m a -> m b -> m c -> m c
- catch :: (MonadUnliftIO m, Exception e) => m a -> (e -> m a) -> m a
- hClose :: MonadIO m => Handle -> m ()
- hIsOpen :: MonadIO m => Handle -> m Bool
- withBinaryFile :: MonadUnliftIO m => FilePath -> IOMode -> (Handle -> m a) -> m a
- newQSem :: MonadIO m => Int -> m QSem
- signalQSem :: MonadIO m => QSem -> m ()
- waitQSem :: MonadIO m => QSem -> m ()
- isHexDigit :: Word8 -> Bool
- compress :: ByteString -> ByteString
- compressWith :: CompressParams -> ByteString -> ByteString
- decompress :: ByteString -> ByteString
- decompressWith :: DecompressParams -> ByteString -> ByteString
- defaultCompressParams :: CompressParams
- defaultDecompressParams :: DecompressParams
- data QSem
- data ConduitT i o (m :: Type -> Type) r
- data ResourceT (m :: Type -> Type) a
- newtype Tagged (s :: k) b = Tagged {
- unTagged :: b
- newtype ShowTrace a = ShowTrace {
- unShowTrace :: a
- newtype DynConfigEnvVar = DynConfigEnvVar String
- data TraceEmbraceConfig = TraceEmbraceConfig {}
- type YamlConfig = YamlConfigG Identity
- data YamlConfigG (a :: Type -> Type) = YamlConfig {}
- type YamlConfigMaybe = YamlConfigG Maybe
- data EnvironmentVariable
- data EnvironmentVariableP
- data HaskellModulePrefixP
- data LeveledModulePrefix = LeveledModulePrefix {
- level :: TraceLevel
- modulePrefix :: Text
- data TraceLevel
- = Trace
- | Info
- | Warning
- | Error
- | TracingDisabled
- data IoSink
- data SinkMode
- = TraceDisabled
- | TraceStd
- | TraceUnsafeIo { }
- | TraceEvent
- data SinkModeP
- data TraceMessageElement
- type TraceMessageFormat = TraceMessageFormatG Identity
- data TraceMessageFormatG (a :: Type -> Type) = TraceMessageFormat {}
- type TraceMessageFormatMaybe = TraceMessageFormatG Maybe
- class MonadIO m => MonadUnliftIO (m :: Type -> Type)
- data CompressParams = CompressParams {}
- data DecompressError
- data DecompressParams = DecompressParams {}
- newtype CompressionLevel = CompressionLevel Int
Documentation
module Control.DeepSeq
module Relude
module System.Time.Extra
module Text.Printf
Arguments
:: forall (m :: Type -> Type) i. MonadResource m | |
=> Bool | Follow directory symlinks |
-> FilePath | Root directory |
-> ConduitT i FilePath m () |
Deeply stream the contents of the given directory.
This works the same as sourceDirectory
, but will not return directories at
all. This function also takes an extra parameter to indicate whether
symlinks will be followed.
Since: conduit-1.3.0
concatC :: forall (m :: Type -> Type) mono. (Monad m, MonoFoldable mono) => ConduitT mono (Element mono) m () #
Flatten out a stream by yielding the values contained in an incoming
MonoFoldable
as individually yielded values.
Since: conduit-1.3.0
foldMC :: Monad m => (a -> b -> m a) -> a -> ConduitT b o m a #
A monadic strict left fold.
Since: conduit-1.3.0
mapMC :: Monad m => (a -> m b) -> ConduitT a b m () #
Apply a monadic transformation to all values in a stream.
If you do not need the transformed values, and instead just want the monadic
side-effects of running the action, see mapM_
.
Since: conduit-1.3.0
Arguments
:: forall (m :: Type -> Type) a b c r. Monad m | |
=> ConduitT a b m () | upstream |
-> ConduitT b c m r | downstream |
-> ConduitT a c m r |
Combine two Conduit
s together into a new Conduit
(aka fuse
).
Output from the upstream (left) conduit will be fed into the
downstream (right) conduit. Processing will terminate when
downstream (right) returns.
Leftover data returned from the right Conduit
will be discarded.
Equivalent to fuse
and =$=
, however the latter is deprecated and will
be removed in a future version.
Note that, while this operator looks like categorical composition (from Control.Category), there are a few reasons it's different:
- The position of the type parameters to
ConduitT
do not match. We would need to changeConduitT i o m r
toConduitT r m i o
, which would preclude aMonad
orMonadTrans
instance. - The result value from upstream and downstream are allowed to
differ between upstream and downstream. In other words, we would
need the type signature here to look like
ConduitT a b m r -> ConduitT b c m r -> ConduitT a c m r
. - Due to leftovers, we do not have a left identity in Conduit. This
can be achieved with the underlying
Pipe
datatype, but this is not generally recommended. See https://stackoverflow.com/a/15263700.
Since: conduit-1.2.8
runConduitRes :: MonadUnliftIO m => ConduitT () Void (ResourceT m) r -> m r #
Run a pipeline which acquires resources with ResourceT
, and
then run the ResourceT
transformer. This is equivalent to
runResourceT . runConduit
.
Since: conduit-1.2.8
(</>) :: FilePath -> FilePath -> FilePath infixr 5 #
Combine two paths with a path separator.
If the second path starts with a path separator or a drive letter, then it returns the second.
The intention is that readFile (dir
will access the same file as
</>
file)setCurrentDirectory dir; readFile file
.
Posix: "/directory" </> "file.ext" == "/directory/file.ext" Windows: "/directory" </> "file.ext" == "/directory\\file.ext" "directory" </> "/file.ext" == "/file.ext" Valid x => (takeDirectory x </> takeFileName x) `equalFilePath` x
Combined:
Posix: "/" </> "test" == "/test" Posix: "home" </> "bob" == "home/bob" Posix: "x:" </> "foo" == "x:/foo" Windows: "C:\\foo" </> "bar" == "C:\\foo\\bar" Windows: "home" </> "bob" == "home\\bob"
Not combined:
Posix: "home" </> "/bob" == "/bob" Windows: "home" </> "C:\\bob" == "C:\\bob"
Not combined (tricky):
On Windows, if a filepath starts with a single slash, it is relative to the
root of the current drive. In [1], this is (confusingly) referred to as an
absolute path.
The current behavior of </>
is to never combine these forms.
Windows: "home" </> "/bob" == "/bob" Windows: "home" </> "\\bob" == "\\bob" Windows: "C:\\home" </> "\\bob" == "\\bob"
On Windows, from [1]: "If a file name begins with only a disk designator
but not the backslash after the colon, it is interpreted as a relative path
to the current directory on the drive with the specified letter."
The current behavior of </>
is to never combine these forms.
Windows: "D:\\foo" </> "C:bar" == "C:bar" Windows: "C:\\foo" </> "C:bar" == "C:bar"
dropFileName :: FilePath -> FilePath #
Drop the filename. Unlike takeDirectory
, this function will leave
a trailing path separator on the directory.
dropFileName "/directory/file.ext" == "/directory/" dropFileName x == fst (splitFileName x) isPrefixOf (takeDrive x) (dropFileName x)
makeRelative :: FilePath -> FilePath -> FilePath #
Contract a filename, based on a relative path. Note that the resulting path
will never introduce ..
paths, as the presence of symlinks means ../b
may not reach a/b
if it starts from a/c
. For a worked example see
this blog post.
The corresponding makeAbsolute
function can be found in
System.Directory
.
makeRelative "/directory" "/directory/file.ext" == "file.ext" Valid x => makeRelative (takeDirectory x) x `equalFilePath` takeFileName x makeRelative x x == "." Valid x y => equalFilePath x y || (isRelative x && makeRelative y x == x) || equalFilePath (y </> makeRelative y x) x Windows: makeRelative "C:\\Home" "c:\\home\\bob" == "bob" Windows: makeRelative "C:\\Home" "c:/home/bob" == "bob" Windows: makeRelative "C:\\Home" "D:\\Home\\Bob" == "D:\\Home\\Bob" Windows: makeRelative "C:\\Home" "C:Home\\Bob" == "C:Home\\Bob" Windows: makeRelative "/Home" "/home/bob" == "bob" Windows: makeRelative "/" "//" == "//" Posix: makeRelative "/Home" "/home/bob" == "/home/bob" Posix: makeRelative "/home/" "/home/bob/foo/bar" == "bob/foo/bar" Posix: makeRelative "/fred" "bob" == "bob" Posix: makeRelative "/file/test" "/file/test/fred" == "fred" Posix: makeRelative "/file/test" "/file/test/fred/" == "fred/" Posix: makeRelative "some/path" "some/path/a/b/c" == "a/b/c"
splitFileName :: FilePath -> (String, String) #
Split a filename into directory and file. </>
is the inverse.
The first component will often end with a trailing slash.
splitFileName "/directory/file.ext" == ("/directory/","file.ext") Valid x => uncurry (</>) (splitFileName x) == x || fst (splitFileName x) == "./" Valid x => isValid (fst (splitFileName x)) splitFileName "file/bob.txt" == ("file/", "bob.txt") splitFileName "file/" == ("file/", "") splitFileName "bob" == ("./", "bob") Posix: splitFileName "/" == ("/","") Windows: splitFileName "c:" == ("c:","") Windows: splitFileName "\\\\?\\A:\\fred" == ("\\\\?\\A:\\","fred") Windows: splitFileName "\\\\?\\A:" == ("\\\\?\\A:","")
getNumCapabilities :: IO Int #
Returns the number of Haskell threads that can run truly
simultaneously (on separate physical processors) at any given time. To change
this value, use setNumCapabilities
.
Since: base-4.4.0.0
(!?) :: [a] -> Int -> Maybe a infixl 9 #
List index (subscript) operator, starting from 0. Returns Nothing
if the index is out of bounds
This is the total variant of the partial !!
operator.
WARNING: This function takes linear time in the index.
Examples
>>>
['a', 'b', 'c'] !? 0
Just 'a'
>>>
['a', 'b', 'c'] !? 2
Just 'c'
>>>
['a', 'b', 'c'] !? 3
Nothing
>>>
['a', 'b', 'c'] !? (-1)
Nothing
configReadToken :: MVar () #
envVarName :: Loc -> EnvironmentVariable -> Maybe DynConfigEnvVar #
traceAll :: [LeveledModulePrefix] #
unsafeIoSink :: IORef (Maybe Handle) #
validateTraceMessageFormat :: String -> TraceMessageFormatMaybe -> Either String (Refined IdPred TraceMessageFormat) #
charToLevel :: String -> (TraceLevel, String) #
traceLevelToChar :: TraceLevel -> Text #
entrySeparator :: forall (a :: Type -> Type) f. Functor f => (Columnar a SeparatorValidator String -> f (Columnar a SeparatorValidator String)) -> TraceMessageFormatG a -> f (TraceMessageFormatG a) #
keyValueSeparator :: forall (a :: Type -> Type) f. Functor f => (Columnar a SeparatorValidator String -> f (Columnar a SeparatorValidator String)) -> TraceMessageFormatG a -> f (TraceMessageFormatG a) #
retValPrefix :: forall (a :: Type -> Type) f. Functor f => (Columnar a SeparatorValidator String -> f (Columnar a SeparatorValidator String)) -> TraceMessageFormatG a -> f (TraceMessageFormatG a) #
traceLinePattern :: forall (a :: Type -> Type) f. Functor f => (Columnar a NonEmpty [TraceMessageElement] -> f (Columnar a NonEmpty [TraceMessageElement])) -> TraceMessageFormatG a -> f (TraceMessageFormatG a) #
TH version of trace
and traceEvent
The message is formatted according to TraceMessageFormat
.
The generated expression has type forall r (a :: TYPE r) b a.
.
Rewrap
a b => a -> aid
is generated if effective trace level is lower than trace level threshold.
Example:
foo x = $(tr "get/x") x
Output:
Module::foo get; x : 132
trFunMarker :: Q Exp #
TH version of traceMarker
where module and function
are used as a marker. Trace level is used.
TH version of traceIO
and traceEventIO
The message is formatted according to TraceMessageFormat
.
Example:
foo x = $(trIo "get/x") >> pure x
Output:
Module::foo get; x : 132
trIoFunMarker :: Q Exp #
TH version of traceMarkerIO
where module and function
are used as a marker. Trace level is not used.
TH version of traceWith
and traceEventWith
The message is formatted according to TraceMessageFormat
.
The generated expression has type forall r (a :: TYPE r) b a. (Show a, Rewrap a b) => a -> a
.
id
is generated if effective trace level is lower than trace level threshold.
Example:
foo x = $(tw "get/x") (x + 1)
Output:
Module::foo get; x : 132 => 133
createDirectory :: MonadIO m => FilePath -> m () #
Lifted createDirectory
.
Since: unliftio-0.2.6.0
createDirectoryIfMissing :: MonadIO m => Bool -> FilePath -> m () #
Lifted createDirectoryIfMissing
.
Since: unliftio-0.2.6.0
Arguments
:: MonadIO m | |
=> FilePath | path to the target file |
-> FilePath | path of the link to be created |
-> m () |
Lifted createFileLink
.
directory package version should be >= 1.3.1.
@since 0.2.16.0
doesDirectoryExist :: MonadIO m => FilePath -> m Bool #
Lifted doesDirectoryExist
.
Since: unliftio-0.2.6.0
doesFileExist :: MonadIO m => FilePath -> m Bool #
Lifted doesFileExist
.
Since: unliftio-0.2.6.0
getSymbolicLinkTarget :: MonadIO m => FilePath -> m FilePath #
Lifted getSymbolicLinkTarget
.
Since: unliftio-0.2.21.0
listDirectory :: MonadIO m => FilePath -> m [FilePath] #
Lifted listDirectory
.
Since: unliftio-0.2.6.0
makeAbsolute :: MonadIO m => FilePath -> m FilePath #
Lifted makeAbsolute
.
Since: unliftio-0.2.6.0
pathIsSymbolicLink :: MonadIO m => FilePath -> m Bool #
Lifted pathIsSymbolicLink
.
Since: unliftio-0.2.6.0
removeFile :: MonadIO m => FilePath -> m () #
Lifted removeFile
.
Since: unliftio-0.2.6.0
bracket :: MonadUnliftIO m => m a -> (a -> m b) -> (a -> m c) -> m c #
Allocate and clean up a resource safely.
For more information on motivation and usage of this function, see base
's
bracket
. This function has two differences from the one in base
.
The first, and more obvious, is that it works on any MonadUnliftIO
instance, not just IO
.
The more subtle difference is that this function will use uninterruptible masking for its cleanup handler. This is a subtle distinction, but at a high level, means that resource cleanup has more guarantees to complete. This comes at the cost that an incorrectly written cleanup function cannot be interrupted.
For more information, please see https://github.com/fpco/safe-exceptions/issues/3.
Since: unliftio-0.1.0.0
bracket_ :: MonadUnliftIO m => m a -> m b -> m c -> m c #
Arguments
:: (MonadUnliftIO m, Exception e) | |
=> m a | action |
-> (e -> m a) | handler |
-> m a |
Catch a synchronous (but not asynchronous) exception and recover from it.
This is parameterized on the exception type. To catch all synchronous exceptions,
use catchAny
.
Since: unliftio-0.1.0.0
withBinaryFile :: MonadUnliftIO m => FilePath -> IOMode -> (Handle -> m a) -> m a #
Unlifted version of withBinaryFile
.
Since: unliftio-0.1.0.0
signalQSem :: MonadIO m => QSem -> m () #
Lifted signalQSem
.
Since: unliftio-0.2.14
isHexDigit :: Word8 -> Bool #
compress :: ByteString -> ByteString #
Compress a stream of data into the zlib format.
This uses the default compression parameters. In particular it uses the default compression level which favours a higher compression ratio over compression speed, though it does not use the maximum compression level.
Use compressWith
to adjust the compression level or other compression
parameters.
compressWith :: CompressParams -> ByteString -> ByteString #
Like compress
but with the ability to specify various compression
parameters. Typical usage:
compressWith defaultCompressParams { ... }
In particular you can set the compression level:
compressWith defaultCompressParams { compressLevel = BestCompression }
decompress :: ByteString -> ByteString #
Decompress a stream of data in the zlib format,
throw DecompressError
on failure.
Note that the decompression is performed lazily. Errors in the data stream may not be detected until the end of the stream is demanded (since it is only at the end that the final checksum can be checked). If this is important to you, you must make sure to consume the whole decompressed stream before doing any IO action that depends on it.
decompressWith :: DecompressParams -> ByteString -> ByteString #
Like decompress
but with the ability to specify various decompression
parameters. Typical usage:
decompressWith defaultCompressParams { ... }
defaultCompressParams :: CompressParams #
The default set of parameters for compression. This is typically used with
compressWith
or compressWith
with specific parameters overridden.
defaultDecompressParams :: DecompressParams #
The default set of parameters for decompression. This is typically used with
decompressWith
or decompressWith
with specific parameters overridden.
data ConduitT i o (m :: Type -> Type) r #
Core datatype of the conduit package. This type represents a general
component which can consume a stream of input values i
, produce a stream
of output values o
, perform actions in the m
monad, and produce a final
result r
. The type synonyms provided here are simply wrappers around this
type.
Since 1.3.0
Instances
data ResourceT (m :: Type -> Type) a #
The Resource transformer. This transformer keeps track of all registered
actions, and calls them upon exit (via runResourceT
). Actions may be
registered via register
, or resources may be allocated atomically via
allocate
. allocate
corresponds closely to bracket
.
Releasing may be performed before exit via the release
function. This is a
highly recommended optimization, as it will ensure that scarce resources are
freed early. Note that calling release
will deregister the action, so that
a release action will only ever be called once.
Since 0.3.0
Instances
MonadTrans ResourceT # | |||||
Defined in Control.Monad.Trans.Resource.Internal | |||||
MonadRWS r w s m => MonadRWS r w s (ResourceT m) # | |||||
Defined in Control.Monad.Trans.Resource.Internal | |||||
MonadError e m => MonadError e (ResourceT m) # | |||||
Defined in Control.Monad.Trans.Resource.Internal Methods throwError :: e -> ResourceT m a # catchError :: ResourceT m a -> (e -> ResourceT m a) -> ResourceT m a # | |||||
MonadReader r m => MonadReader r (ResourceT m) # | |||||
MonadState s m => MonadState s (ResourceT m) # | |||||
MonadWriter w m => MonadWriter w (ResourceT m) # | |||||
MonadCatch m => MonadCatch (ResourceT m) # | |||||
Defined in Control.Monad.Trans.Resource.Internal | |||||
MonadMask m => MonadMask (ResourceT m) # | |||||
Defined in Control.Monad.Trans.Resource.Internal Methods mask :: HasCallStack => ((forall a. ResourceT m a -> ResourceT m a) -> ResourceT m b) -> ResourceT m b # uninterruptibleMask :: HasCallStack => ((forall a. ResourceT m a -> ResourceT m a) -> ResourceT m b) -> ResourceT m b # generalBracket :: HasCallStack => ResourceT m a -> (a -> ExitCase b -> ResourceT m c) -> (a -> ResourceT m b) -> ResourceT m (b, c) # | |||||
MonadThrow m => MonadThrow (ResourceT m) # | |||||
Defined in Control.Monad.Trans.Resource.Internal Methods throwM :: (HasCallStack, Exception e) => e -> ResourceT m a # | |||||
Alternative m => Alternative (ResourceT m) # | Since 1.1.5 | ||||
Applicative m => Applicative (ResourceT m) # | |||||
Defined in Control.Monad.Trans.Resource.Internal | |||||
Functor m => Functor (ResourceT m) # | |||||
Monad m => Monad (ResourceT m) # | |||||
MonadPlus m => MonadPlus (ResourceT m) # | Since 1.1.5 | ||||
MonadFail m => MonadFail (ResourceT m) # | Since: resourcet-1.2.2 | ||||
Defined in Control.Monad.Trans.Resource.Internal | |||||
MonadFix m => MonadFix (ResourceT m) # | Since: resourcet-1.1.8 | ||||
Defined in Control.Monad.Trans.Resource.Internal | |||||
MonadIO m => MonadIO (ResourceT m) # | |||||
Defined in Control.Monad.Trans.Resource.Internal | |||||
(Monad m, HasInHandlesSem m) => HasInHandlesSem (ResourceT m) Source # | |||||
Defined in Data.Git.Phoenix.Io Methods getInHandlesSem :: ResourceT m QSem Source # | |||||
MonadCont m => MonadCont (ResourceT m) # | |||||
PrimMonad m => PrimMonad (ResourceT m) # | |||||
Defined in Control.Monad.Trans.Resource.Internal Associated Types
| |||||
MonadIO m => MonadResource (ResourceT m) # | |||||
Defined in Control.Monad.Trans.Resource.Internal Methods liftResourceT :: ResourceT IO a -> ResourceT m a # | |||||
MonadUnliftIO m => MonadUnliftIO (ResourceT m) # | Since: resourcet-1.1.10 | ||||
Defined in Control.Monad.Trans.Resource.Internal | |||||
type PrimState (ResourceT m) # | |||||
Defined in Control.Monad.Trans.Resource.Internal |
A
value is a value Tagged
s bb
with an attached phantom type s
.
This can be used in place of the more traditional but less safe idiom of
passing in an undefined value with the type, because unlike an (s -> b)
,
a
can't try to use the argument Tagged
s bs
as a real value.
Moreover, you don't have to rely on the compiler to inline away the extra argument, because the newtype is "free"
Tagged
has kind k -> * -> *
if the compiler supports PolyKinds
, therefore
there is an extra k
showing in the instance haddocks that may cause confusion.
Instances
Generic1 (Tagged s :: Type -> Type) # | |||||
Defined in Data.Tagged Associated Types
| |||||
Bifoldable (Tagged :: Type -> Type -> Type) # | |||||
Bifoldable1 (Tagged :: Type -> Type -> Type) # | |||||
Defined in Data.Tagged | |||||
Bifunctor (Tagged :: Type -> Type -> Type) # | |||||
Bitraversable (Tagged :: Type -> Type -> Type) # | |||||
Defined in Data.Tagged Methods bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> Tagged a b -> f (Tagged c d) # | |||||
Eq2 (Tagged :: Type -> Type -> Type) # | |||||
Ord2 (Tagged :: Type -> Type -> Type) # | |||||
Defined in Data.Tagged | |||||
Read2 (Tagged :: Type -> Type -> Type) # | |||||
Defined in Data.Tagged Methods liftReadsPrec2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> Int -> ReadS (Tagged a b) # liftReadList2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> ReadS [Tagged a b] # liftReadPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec (Tagged a b) # liftReadListPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec [Tagged a b] # | |||||
Show2 (Tagged :: Type -> Type -> Type) # | |||||
Show (ShowTrace a) => Show (ShowTrace (Tagged t a)) # | |||||
Show (ShowTrace a) => Show (ShowTrace [Tagged t a]) # | |||||
Corepresentable (Tagged :: Type -> Type -> Type) # | |||||
Representable (Tagged t) # | |||||
Foldable1 (Tagged a) # | |||||
Defined in Data.Tagged Methods fold1 :: Semigroup m => Tagged a m -> m # foldMap1 :: Semigroup m => (a0 -> m) -> Tagged a a0 -> m # foldMap1' :: Semigroup m => (a0 -> m) -> Tagged a a0 -> m # toNonEmpty :: Tagged a a0 -> NonEmpty a0 # maximum :: Ord a0 => Tagged a a0 -> a0 # minimum :: Ord a0 => Tagged a a0 -> a0 # foldrMap1 :: (a0 -> b) -> (a0 -> b -> b) -> Tagged a a0 -> b # foldlMap1' :: (a0 -> b) -> (b -> a0 -> b) -> Tagged a a0 -> b # foldlMap1 :: (a0 -> b) -> (b -> a0 -> b) -> Tagged a a0 -> b # foldrMap1' :: (a0 -> b) -> (a0 -> b -> b) -> Tagged a a0 -> b # | |||||
Eq1 (Tagged s) # | |||||
Ord1 (Tagged s) # | |||||
Defined in Data.Tagged | |||||
Read1 (Tagged s) # | |||||
Defined in Data.Tagged | |||||
Show1 (Tagged s) # | |||||
Applicative (Tagged s) # | |||||
Functor (Tagged s) # | |||||
Monad (Tagged s) # | |||||
Foldable (Tagged s) # | |||||
Defined in Data.Tagged Methods fold :: Monoid m => Tagged s m -> m # foldMap :: Monoid m => (a -> m) -> Tagged s a -> m # foldMap' :: Monoid m => (a -> m) -> Tagged s a -> m # foldr :: (a -> b -> b) -> b -> Tagged s a -> b # foldr' :: (a -> b -> b) -> b -> Tagged s a -> b # foldl :: (b -> a -> b) -> b -> Tagged s a -> b # foldl' :: (b -> a -> b) -> b -> Tagged s a -> b # foldr1 :: (a -> a -> a) -> Tagged s a -> a # foldl1 :: (a -> a -> a) -> Tagged s a -> a # elem :: Eq a => a -> Tagged s a -> Bool # maximum :: Ord a => Tagged s a -> a # minimum :: Ord a => Tagged s a -> a # | |||||
Traversable (Tagged s) # | |||||
NFData b => NFData (Tagged s b) # | |||||
Defined in Data.Tagged | |||||
(Semigroup a, Monoid a) => Monoid (Tagged s a) # | |||||
Semigroup a => Semigroup (Tagged s a) # | |||||
Bits a => Bits (Tagged s a) # | |||||
Defined in Data.Tagged Methods (.&.) :: Tagged s a -> Tagged s a -> Tagged s a # (.|.) :: Tagged s a -> Tagged s a -> Tagged s a # xor :: Tagged s a -> Tagged s a -> Tagged s a # complement :: Tagged s a -> Tagged s a # shift :: Tagged s a -> Int -> Tagged s a # rotate :: Tagged s a -> Int -> Tagged s a # setBit :: Tagged s a -> Int -> Tagged s a # clearBit :: Tagged s a -> Int -> Tagged s a # complementBit :: Tagged s a -> Int -> Tagged s a # testBit :: Tagged s a -> Int -> Bool # bitSizeMaybe :: Tagged s a -> Maybe Int # bitSize :: Tagged s a -> Int # isSigned :: Tagged s a -> Bool # shiftL :: Tagged s a -> Int -> Tagged s a # unsafeShiftL :: Tagged s a -> Int -> Tagged s a # shiftR :: Tagged s a -> Int -> Tagged s a # unsafeShiftR :: Tagged s a -> Int -> Tagged s a # rotateL :: Tagged s a -> Int -> Tagged s a # | |||||
FiniteBits a => FiniteBits (Tagged s a) # | |||||
Defined in Data.Tagged Methods finiteBitSize :: Tagged s a -> Int # countLeadingZeros :: Tagged s a -> Int # countTrailingZeros :: Tagged s a -> Int # | |||||
(Data s, Data b) => Data (Tagged s b) # | |||||
Defined in Data.Tagged Methods gfoldl :: (forall d b0. Data d => c (d -> b0) -> d -> c b0) -> (forall g. g -> c g) -> Tagged s b -> c (Tagged s b) # gunfold :: (forall b0 r. Data b0 => c (b0 -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Tagged s b) # toConstr :: Tagged s b -> Constr # dataTypeOf :: Tagged s b -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Tagged s b)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Tagged s b)) # gmapT :: (forall b0. Data b0 => b0 -> b0) -> Tagged s b -> Tagged s b # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Tagged s b -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Tagged s b -> r # gmapQ :: (forall d. Data d => d -> u) -> Tagged s b -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Tagged s b -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Tagged s b -> m (Tagged s b) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Tagged s b -> m (Tagged s b) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Tagged s b -> m (Tagged s b) # | |||||
IsString a => IsString (Tagged s a) # | |||||
Defined in Data.Tagged Methods fromString :: String -> Tagged s a # | |||||
Bounded b => Bounded (Tagged s b) # | |||||
Enum a => Enum (Tagged s a) # | |||||
Defined in Data.Tagged Methods succ :: Tagged s a -> Tagged s a # pred :: Tagged s a -> Tagged s a # fromEnum :: Tagged s a -> Int # enumFrom :: Tagged s a -> [Tagged s a] # enumFromThen :: Tagged s a -> Tagged s a -> [Tagged s a] # enumFromTo :: Tagged s a -> Tagged s a -> [Tagged s a] # enumFromThenTo :: Tagged s a -> Tagged s a -> Tagged s a -> [Tagged s a] # | |||||
Floating a => Floating (Tagged s a) # | |||||
Defined in Data.Tagged Methods exp :: Tagged s a -> Tagged s a # log :: Tagged s a -> Tagged s a # sqrt :: Tagged s a -> Tagged s a # (**) :: Tagged s a -> Tagged s a -> Tagged s a # logBase :: Tagged s a -> Tagged s a -> Tagged s a # sin :: Tagged s a -> Tagged s a # cos :: Tagged s a -> Tagged s a # tan :: Tagged s a -> Tagged s a # asin :: Tagged s a -> Tagged s a # acos :: Tagged s a -> Tagged s a # atan :: Tagged s a -> Tagged s a # sinh :: Tagged s a -> Tagged s a # cosh :: Tagged s a -> Tagged s a # tanh :: Tagged s a -> Tagged s a # asinh :: Tagged s a -> Tagged s a # acosh :: Tagged s a -> Tagged s a # atanh :: Tagged s a -> Tagged s a # log1p :: Tagged s a -> Tagged s a # expm1 :: Tagged s a -> Tagged s a # | |||||
RealFloat a => RealFloat (Tagged s a) # | |||||
Defined in Data.Tagged Methods floatRadix :: Tagged s a -> Integer # floatDigits :: Tagged s a -> Int # floatRange :: Tagged s a -> (Int, Int) # decodeFloat :: Tagged s a -> (Integer, Int) # encodeFloat :: Integer -> Int -> Tagged s a # exponent :: Tagged s a -> Int # significand :: Tagged s a -> Tagged s a # scaleFloat :: Int -> Tagged s a -> Tagged s a # isInfinite :: Tagged s a -> Bool # isDenormalized :: Tagged s a -> Bool # isNegativeZero :: Tagged s a -> Bool # | |||||
Storable a => Storable (Tagged s a) # | |||||
Defined in Data.Tagged Methods alignment :: Tagged s a -> Int # peekElemOff :: Ptr (Tagged s a) -> Int -> IO (Tagged s a) # pokeElemOff :: Ptr (Tagged s a) -> Int -> Tagged s a -> IO () # peekByteOff :: Ptr b -> Int -> IO (Tagged s a) # pokeByteOff :: Ptr b -> Int -> Tagged s a -> IO () # | |||||
Generic (Tagged s b) # | |||||
Defined in Data.Tagged Associated Types
| |||||
Ix b => Ix (Tagged s b) # | |||||
Defined in Data.Tagged Methods range :: (Tagged s b, Tagged s b) -> [Tagged s b] # index :: (Tagged s b, Tagged s b) -> Tagged s b -> Int # unsafeIndex :: (Tagged s b, Tagged s b) -> Tagged s b -> Int # inRange :: (Tagged s b, Tagged s b) -> Tagged s b -> Bool # rangeSize :: (Tagged s b, Tagged s b) -> Int # unsafeRangeSize :: (Tagged s b, Tagged s b) -> Int # | |||||
Num a => Num (Tagged s a) # | |||||
Defined in Data.Tagged | |||||
Read b => Read (Tagged s b) # | |||||
Fractional a => Fractional (Tagged s a) # | |||||
Integral a => Integral (Tagged s a) # | |||||
Defined in Data.Tagged Methods quot :: Tagged s a -> Tagged s a -> Tagged s a # rem :: Tagged s a -> Tagged s a -> Tagged s a # div :: Tagged s a -> Tagged s a -> Tagged s a # mod :: Tagged s a -> Tagged s a -> Tagged s a # quotRem :: Tagged s a -> Tagged s a -> (Tagged s a, Tagged s a) # divMod :: Tagged s a -> Tagged s a -> (Tagged s a, Tagged s a) # | |||||
Real a => Real (Tagged s a) # | |||||
Defined in Data.Tagged Methods toRational :: Tagged s a -> Rational # | |||||
RealFrac a => RealFrac (Tagged s a) # | |||||
Show b => Show (Tagged s b) # | |||||
Eq b => Eq (Tagged s b) # | |||||
Ord b => Ord (Tagged s b) # | |||||
Wrapped (Tagged s a) # | |||||
t ~ Tagged s' a' => Rewrapped (Tagged s a) t # | |||||
Defined in Control.Lens.Wrapped | |||||
type Rep1 (Tagged s :: Type -> Type) # | |||||
Defined in Data.Tagged | |||||
type Corep (Tagged :: Type -> Type -> Type) # | |||||
type Rep (Tagged t) # | |||||
Defined in Data.Functor.Rep | |||||
type Rep (Tagged s b) # | |||||
Defined in Data.Tagged | |||||
type Unwrapped (Tagged s a) # | |||||
Defined in Control.Lens.Wrapped |
Wrap value which has opaque Show
instance.
Constructors
ShowTrace | |
Fields
|
Instances
Show (ShowTrace ByteString) # | |
Defined in Debug.TraceEmbrace.ByteString | |
Show (ShowTrace ByteString) # | |
Defined in Debug.TraceEmbrace.ByteString | |
Show (ShowTrace a) => Show (ShowTrace (Tagged t a)) # | |
Show (ShowTrace a) => Show (ShowTrace (Maybe a)) # | |
Show (ShowTrace a) => Show (ShowTrace [Tagged t a]) # | |
Show (ShowTrace a) => Show (ShowTrace [a]) # | |
newtype DynConfigEnvVar #
Constructors
DynConfigEnvVar String |
Instances
Show DynConfigEnvVar # | |
Defined in Debug.TraceEmbrace.Config.Load Methods showsPrec :: Int -> DynConfigEnvVar -> ShowS # show :: DynConfigEnvVar -> String # showList :: [DynConfigEnvVar] -> ShowS # | |
Eq DynConfigEnvVar # | |
Defined in Debug.TraceEmbrace.Config.Load Methods (==) :: DynConfigEnvVar -> DynConfigEnvVar -> Bool # (/=) :: DynConfigEnvVar -> DynConfigEnvVar -> Bool # | |
Ord DynConfigEnvVar # | |
Defined in Debug.TraceEmbrace.Config.Load Methods compare :: DynConfigEnvVar -> DynConfigEnvVar -> Ordering # (<) :: DynConfigEnvVar -> DynConfigEnvVar -> Bool # (<=) :: DynConfigEnvVar -> DynConfigEnvVar -> Bool # (>) :: DynConfigEnvVar -> DynConfigEnvVar -> Bool # (>=) :: DynConfigEnvVar -> DynConfigEnvVar -> Bool # max :: DynConfigEnvVar -> DynConfigEnvVar -> DynConfigEnvVar # min :: DynConfigEnvVar -> DynConfigEnvVar -> DynConfigEnvVar # | |
Lift DynConfigEnvVar # | |
Defined in Debug.TraceEmbrace.Config.Load Methods lift :: Quote m => DynConfigEnvVar -> m Exp # liftTyped :: forall (m :: Type -> Type). Quote m => DynConfigEnvVar -> Code m DynConfigEnvVar # |
data TraceEmbraceConfig #
Constructors
TraceEmbraceConfig | |
Instances
Generic TraceEmbraceConfig # | |||||
Defined in Debug.TraceEmbrace.Config.Type Associated Types
Methods from :: TraceEmbraceConfig -> Rep TraceEmbraceConfig x # to :: Rep TraceEmbraceConfig x -> TraceEmbraceConfig # | |||||
Show TraceEmbraceConfig # | |||||
Defined in Debug.TraceEmbrace.Config.Type Methods showsPrec :: Int -> TraceEmbraceConfig -> ShowS # show :: TraceEmbraceConfig -> String # showList :: [TraceEmbraceConfig] -> ShowS # | |||||
Eq TraceEmbraceConfig # | |||||
Defined in Debug.TraceEmbrace.Config.Type Methods (==) :: TraceEmbraceConfig -> TraceEmbraceConfig -> Bool # (/=) :: TraceEmbraceConfig -> TraceEmbraceConfig -> Bool # | |||||
type Rep TraceEmbraceConfig # | |||||
Defined in Debug.TraceEmbrace.Config.Type type Rep TraceEmbraceConfig = D1 ('MetaData "TraceEmbraceConfig" "Debug.TraceEmbrace.Config.Type" "trace-embrace-1.2.0-CmI2KHZh5yZHIowi15ioHX" 'False) (C1 ('MetaCons "TraceEmbraceConfig" 'PrefixI 'True) ((S1 ('MetaSel ('Just "mode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SinkMode) :*: S1 ('MetaSel ('Just "traceMessage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TraceMessageFormat)) :*: (S1 ('MetaSel ('Just "levels") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (StrictRadixTree TraceLevel)) :*: S1 ('MetaSel ('Just "runtimeLevelsOverrideEnvVar") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 EnvironmentVariable)))) |
type YamlConfig = YamlConfigG Identity #
data YamlConfigG (a :: Type -> Type) #
Constructors
YamlConfig | |
Fields
|
Instances
FromJSON YamlConfig # | |||||||||
Defined in Debug.TraceEmbrace.Config.Type | |||||||||
FromJSON YamlConfigMaybe # | |||||||||
Defined in Debug.TraceEmbrace.Config.Type Methods parseJSON :: Value -> Parser YamlConfigMaybe # parseJSONList :: Value -> Parser [YamlConfigMaybe] # | |||||||||
ToJSON YamlConfig # | |||||||||
Defined in Debug.TraceEmbrace.Config.Type Methods toJSON :: YamlConfig -> Value # toEncoding :: YamlConfig -> Encoding # toJSONList :: [YamlConfig] -> Value # toEncodingList :: [YamlConfig] -> Encoding # omitField :: YamlConfig -> Bool # | |||||||||
ToJSON YamlConfigMaybe # | |||||||||
Defined in Debug.TraceEmbrace.Config.Type Methods toJSON :: YamlConfigMaybe -> Value # toEncoding :: YamlConfigMaybe -> Encoding # toJSONList :: [YamlConfigMaybe] -> Value # toEncodingList :: [YamlConfigMaybe] -> Encoding # omitField :: YamlConfigMaybe -> Bool # | |||||||||
Semigroup YamlConfigMaybe # | |||||||||
Defined in Debug.TraceEmbrace.Config.Type Methods (<>) :: YamlConfigMaybe -> YamlConfigMaybe -> YamlConfigMaybe # sconcat :: NonEmpty YamlConfigMaybe -> YamlConfigMaybe # stimes :: Integral b => b -> YamlConfigMaybe -> YamlConfigMaybe # | |||||||||
Generic YamlConfig # | |||||||||
Defined in Debug.TraceEmbrace.Config.Type Associated Types
| |||||||||
Generic YamlConfigMaybe # | |||||||||
Defined in Debug.TraceEmbrace.Config.Type Methods from :: YamlConfigMaybe -> Rep YamlConfigMaybe x # to :: Rep YamlConfigMaybe x -> YamlConfigMaybe # | |||||||||
Show YamlConfig # | |||||||||
Defined in Debug.TraceEmbrace.Config.Type Methods showsPrec :: Int -> YamlConfig -> ShowS # show :: YamlConfig -> String # showList :: [YamlConfig] -> ShowS # | |||||||||
Show YamlConfigMaybe # | |||||||||
Defined in Debug.TraceEmbrace.Config.Type Methods showsPrec :: Int -> YamlConfigMaybe -> ShowS # show :: YamlConfigMaybe -> String # showList :: [YamlConfigMaybe] -> ShowS # | |||||||||
Eq YamlConfig # | |||||||||
Defined in Debug.TraceEmbrace.Config.Type | |||||||||
Eq YamlConfigMaybe # | |||||||||
Defined in Debug.TraceEmbrace.Config.Type Methods (==) :: YamlConfigMaybe -> YamlConfigMaybe -> Bool # (/=) :: YamlConfigMaybe -> YamlConfigMaybe -> Bool # | |||||||||
type Rep (YamlConfigG Identity) # | |||||||||
Defined in Debug.TraceEmbrace.Config.Type type Rep (YamlConfigG Identity) = D1 ('MetaData "YamlConfigG" "Debug.TraceEmbrace.Config.Type" "trace-embrace-1.2.0-CmI2KHZh5yZHIowi15ioHX" 'False) (C1 ('MetaCons "YamlConfig" 'PrefixI 'True) ((S1 ('MetaSel ('Just "mode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Columnar Identity SinkModeP SinkMode)) :*: S1 ('MetaSel ('Just "version") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Columnar Identity (And (GreaterThan 0) (LessThan 2)) Int))) :*: (S1 ('MetaSel ('Just "traceMessage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Columnar Identity IdPred (TraceMessageFormatG Identity))) :*: (S1 ('MetaSel ('Just "levels") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Columnar Identity HaskellModulePrefixP [LeveledModulePrefix])) :*: S1 ('MetaSel ('Just "runtimeLevelsOverrideEnvVar") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Columnar Identity EnvironmentVariableP EnvironmentVariable)))))) | |||||||||
type Rep (YamlConfigG Identity) # | |||||||||
Defined in Debug.TraceEmbrace.Config.Type type Rep (YamlConfigG Identity) = D1 ('MetaData "YamlConfigG" "Debug.TraceEmbrace.Config.Type" "trace-embrace-1.2.0-CmI2KHZh5yZHIowi15ioHX" 'False) (C1 ('MetaCons "YamlConfig" 'PrefixI 'True) ((S1 ('MetaSel ('Just "mode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Columnar Identity SinkModeP SinkMode)) :*: S1 ('MetaSel ('Just "version") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Columnar Identity (And (GreaterThan 0) (LessThan 2)) Int))) :*: (S1 ('MetaSel ('Just "traceMessage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Columnar Identity IdPred (TraceMessageFormatG Identity))) :*: (S1 ('MetaSel ('Just "levels") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Columnar Identity HaskellModulePrefixP [LeveledModulePrefix])) :*: S1 ('MetaSel ('Just "runtimeLevelsOverrideEnvVar") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Columnar Identity EnvironmentVariableP EnvironmentVariable)))))) |
type YamlConfigMaybe = YamlConfigG Maybe #
data EnvironmentVariable #
Name of environment variable name.
Constructors
Ignored | |
CapsPackageName | Use upcased package name non alphanum chars are replaced with |
EnvironmentVariable | |
Instances
FromJSON EnvironmentVariable # | |||||
Defined in Debug.TraceEmbrace.Config.Type.EnvVar Methods parseJSON :: Value -> Parser EnvironmentVariable # parseJSONList :: Value -> Parser [EnvironmentVariable] # | |||||
ToJSON EnvironmentVariable # | |||||
Defined in Debug.TraceEmbrace.Config.Type.EnvVar Methods toJSON :: EnvironmentVariable -> Value # toEncoding :: EnvironmentVariable -> Encoding # toJSONList :: [EnvironmentVariable] -> Value # toEncodingList :: [EnvironmentVariable] -> Encoding # omitField :: EnvironmentVariable -> Bool # | |||||
Generic EnvironmentVariable # | |||||
Defined in Debug.TraceEmbrace.Config.Type.EnvVar Associated Types
Methods from :: EnvironmentVariable -> Rep EnvironmentVariable x # to :: Rep EnvironmentVariable x -> EnvironmentVariable # | |||||
Show EnvironmentVariable # | |||||
Defined in Debug.TraceEmbrace.Config.Type.EnvVar Methods showsPrec :: Int -> EnvironmentVariable -> ShowS # show :: EnvironmentVariable -> String # showList :: [EnvironmentVariable] -> ShowS # | |||||
Eq EnvironmentVariable # | |||||
Defined in Debug.TraceEmbrace.Config.Type.EnvVar Methods (==) :: EnvironmentVariable -> EnvironmentVariable -> Bool # (/=) :: EnvironmentVariable -> EnvironmentVariable -> Bool # | |||||
Ord EnvironmentVariable # | |||||
Defined in Debug.TraceEmbrace.Config.Type.EnvVar Methods compare :: EnvironmentVariable -> EnvironmentVariable -> Ordering # (<) :: EnvironmentVariable -> EnvironmentVariable -> Bool # (<=) :: EnvironmentVariable -> EnvironmentVariable -> Bool # (>) :: EnvironmentVariable -> EnvironmentVariable -> Bool # (>=) :: EnvironmentVariable -> EnvironmentVariable -> Bool # max :: EnvironmentVariable -> EnvironmentVariable -> EnvironmentVariable # min :: EnvironmentVariable -> EnvironmentVariable -> EnvironmentVariable # | |||||
Predicate EnvironmentVariableP EnvironmentVariable # | |||||
Defined in Debug.TraceEmbrace.Config.Type.EnvVar Methods validate :: Proxy EnvironmentVariableP -> EnvironmentVariable -> Maybe RefineException # | |||||
type Rep EnvironmentVariable # | |||||
Defined in Debug.TraceEmbrace.Config.Type.EnvVar type Rep EnvironmentVariable = D1 ('MetaData "EnvironmentVariable" "Debug.TraceEmbrace.Config.Type.EnvVar" "trace-embrace-1.2.0-CmI2KHZh5yZHIowi15ioHX" 'False) (C1 ('MetaCons "Ignored" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "CapsPackageName" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "EnvironmentVariable" 'PrefixI 'True) (S1 ('MetaSel ('Just "varName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))) |
data EnvironmentVariableP #
Instances
data HaskellModulePrefixP #
Instances
Predicate HaskellModulePrefixP LeveledModulePrefix # | |
Defined in Debug.TraceEmbrace.Config.Type.Level Methods validate :: Proxy HaskellModulePrefixP -> LeveledModulePrefix -> Maybe RefineException # | |
Predicate HaskellModulePrefixP [LeveledModulePrefix] # | |
Defined in Debug.TraceEmbrace.Config.Type.Level Methods validate :: Proxy HaskellModulePrefixP -> [LeveledModulePrefix] -> Maybe RefineException # |
data LeveledModulePrefix #
Constructors
LeveledModulePrefix | |
Fields
|
Instances
FromJSON LeveledModulePrefix # | |||||
Defined in Debug.TraceEmbrace.Config.Type.Level Methods parseJSON :: Value -> Parser LeveledModulePrefix # parseJSONList :: Value -> Parser [LeveledModulePrefix] # | |||||
ToJSON LeveledModulePrefix # | |||||
Defined in Debug.TraceEmbrace.Config.Type.Level Methods toJSON :: LeveledModulePrefix -> Value # toEncoding :: LeveledModulePrefix -> Encoding # toJSONList :: [LeveledModulePrefix] -> Value # toEncodingList :: [LeveledModulePrefix] -> Encoding # omitField :: LeveledModulePrefix -> Bool # | |||||
Generic LeveledModulePrefix # | |||||
Defined in Debug.TraceEmbrace.Config.Type.Level Associated Types
Methods from :: LeveledModulePrefix -> Rep LeveledModulePrefix x # to :: Rep LeveledModulePrefix x -> LeveledModulePrefix # | |||||
Show LeveledModulePrefix # | |||||
Defined in Debug.TraceEmbrace.Config.Type.Level Methods showsPrec :: Int -> LeveledModulePrefix -> ShowS # show :: LeveledModulePrefix -> String # showList :: [LeveledModulePrefix] -> ShowS # | |||||
Eq LeveledModulePrefix # | |||||
Defined in Debug.TraceEmbrace.Config.Type.Level Methods (==) :: LeveledModulePrefix -> LeveledModulePrefix -> Bool # (/=) :: LeveledModulePrefix -> LeveledModulePrefix -> Bool # | |||||
Predicate HaskellModulePrefixP LeveledModulePrefix # | |||||
Defined in Debug.TraceEmbrace.Config.Type.Level Methods validate :: Proxy HaskellModulePrefixP -> LeveledModulePrefix -> Maybe RefineException # | |||||
Predicate HaskellModulePrefixP [LeveledModulePrefix] # | |||||
Defined in Debug.TraceEmbrace.Config.Type.Level Methods validate :: Proxy HaskellModulePrefixP -> [LeveledModulePrefix] -> Maybe RefineException # | |||||
type Rep LeveledModulePrefix # | |||||
Defined in Debug.TraceEmbrace.Config.Type.Level type Rep LeveledModulePrefix = D1 ('MetaData "LeveledModulePrefix" "Debug.TraceEmbrace.Config.Type.Level" "trace-embrace-1.2.0-CmI2KHZh5yZHIowi15ioHX" 'False) (C1 ('MetaCons "LeveledModulePrefix" 'PrefixI 'True) (S1 ('MetaSel ('Just "level") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TraceLevel) :*: S1 ('MetaSel ('Just "modulePrefix") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) |
data TraceLevel #
Constructors
Trace | |
Info | |
Warning | |
Error | |
TracingDisabled |
Instances
Bounded TraceLevel # | |||||
Defined in Debug.TraceEmbrace.Config.Type.Level | |||||
Enum TraceLevel # | |||||
Defined in Debug.TraceEmbrace.Config.Type.Level Methods succ :: TraceLevel -> TraceLevel # pred :: TraceLevel -> TraceLevel # toEnum :: Int -> TraceLevel # fromEnum :: TraceLevel -> Int # enumFrom :: TraceLevel -> [TraceLevel] # enumFromThen :: TraceLevel -> TraceLevel -> [TraceLevel] # enumFromTo :: TraceLevel -> TraceLevel -> [TraceLevel] # enumFromThenTo :: TraceLevel -> TraceLevel -> TraceLevel -> [TraceLevel] # | |||||
Generic TraceLevel # | |||||
Defined in Debug.TraceEmbrace.Config.Type.Level Associated Types
| |||||
Show TraceLevel # | |||||
Defined in Debug.TraceEmbrace.Config.Type.Level Methods showsPrec :: Int -> TraceLevel -> ShowS # show :: TraceLevel -> String # showList :: [TraceLevel] -> ShowS # | |||||
Eq TraceLevel # | |||||
Defined in Debug.TraceEmbrace.Config.Type.Level | |||||
Ord TraceLevel # | |||||
Defined in Debug.TraceEmbrace.Config.Type.Level Methods compare :: TraceLevel -> TraceLevel -> Ordering # (<) :: TraceLevel -> TraceLevel -> Bool # (<=) :: TraceLevel -> TraceLevel -> Bool # (>) :: TraceLevel -> TraceLevel -> Bool # (>=) :: TraceLevel -> TraceLevel -> Bool # max :: TraceLevel -> TraceLevel -> TraceLevel # min :: TraceLevel -> TraceLevel -> TraceLevel # | |||||
Lift TraceLevel # | |||||
Defined in Debug.TraceEmbrace.Config.Type.Level Methods lift :: Quote m => TraceLevel -> m Exp # liftTyped :: forall (m :: Type -> Type). Quote m => TraceLevel -> Code m TraceLevel # | |||||
type Rep TraceLevel # | |||||
Defined in Debug.TraceEmbrace.Config.Type.Level type Rep TraceLevel = D1 ('MetaData "TraceLevel" "Debug.TraceEmbrace.Config.Type.Level" "trace-embrace-1.2.0-CmI2KHZh5yZHIowi15ioHX" 'False) ((C1 ('MetaCons "Trace" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Info" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Warning" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Error" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TracingDisabled" 'PrefixI 'False) (U1 :: Type -> Type)))) |
Constructors
StdErrSink | |
StdOutSink | |
FileSink FilePath |
Instances
FromJSON IoSink # | |||||
Defined in Debug.TraceEmbrace.Config.Type.Mode | |||||
ToJSON IoSink # | |||||
Generic IoSink # | |||||
Defined in Debug.TraceEmbrace.Config.Type.Mode Associated Types
| |||||
Show IoSink # | |||||
Eq IoSink # | |||||
Lift IoSink # | |||||
type Rep IoSink # | |||||
Defined in Debug.TraceEmbrace.Config.Type.Mode type Rep IoSink = D1 ('MetaData "IoSink" "Debug.TraceEmbrace.Config.Type.Mode" "trace-embrace-1.2.0-CmI2KHZh5yZHIowi15ioHX" 'False) (C1 ('MetaCons "StdErrSink" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "StdOutSink" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "FileSink" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath)))) |
Constructors
TraceDisabled | |
TraceStd | |
TraceUnsafeIo | |
TraceEvent |
Instances
FromJSON SinkMode # | |||||
Defined in Debug.TraceEmbrace.Config.Type.Mode | |||||
ToJSON SinkMode # | |||||
Generic SinkMode # | |||||
Defined in Debug.TraceEmbrace.Config.Type.Mode Associated Types
| |||||
Show SinkMode # | |||||
Eq SinkMode # | |||||
Lift SinkMode # | |||||
Predicate SinkModeP SinkMode # | |||||
Defined in Debug.TraceEmbrace.Config.Type.Mode | |||||
type Rep SinkMode # | |||||
Defined in Debug.TraceEmbrace.Config.Type.Mode type Rep SinkMode = D1 ('MetaData "SinkMode" "Debug.TraceEmbrace.Config.Type.Mode" "trace-embrace-1.2.0-CmI2KHZh5yZHIowi15ioHX" 'False) ((C1 ('MetaCons "TraceDisabled" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TraceStd" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "TraceUnsafeIo" 'PrefixI 'True) (S1 ('MetaSel ('Just "sink") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IoSink)) :+: C1 ('MetaCons "TraceEvent" 'PrefixI 'False) (U1 :: Type -> Type))) |
data TraceMessageElement #
Constructors
LiteralMessage | Constant tracing message |
Variables | Variables e.g. |
FullyQualifiedModule | Full Haskell module name (e.g. |
ModuleName | Unqualified Haskell module name (e.g. |
ShortenJavaModule | D.M.Strict |
PackageName | Cabal package name |
FunctionName | Function or method name containing tracing |
LineNumber | Line number with tracing |
Delimiter String |
Instances
FromJSON TraceMessageElement # | |||||
Defined in Debug.TraceEmbrace.Config.Type.TraceMessage Methods parseJSON :: Value -> Parser TraceMessageElement # parseJSONList :: Value -> Parser [TraceMessageElement] # | |||||
ToJSON TraceMessageElement # | |||||
Defined in Debug.TraceEmbrace.Config.Type.TraceMessage Methods toJSON :: TraceMessageElement -> Value # toEncoding :: TraceMessageElement -> Encoding # toJSONList :: [TraceMessageElement] -> Value # toEncodingList :: [TraceMessageElement] -> Encoding # omitField :: TraceMessageElement -> Bool # | |||||
Generic TraceMessageElement # | |||||
Defined in Debug.TraceEmbrace.Config.Type.TraceMessage Associated Types
Methods from :: TraceMessageElement -> Rep TraceMessageElement x # to :: Rep TraceMessageElement x -> TraceMessageElement # | |||||
Show TraceMessageElement # | |||||
Defined in Debug.TraceEmbrace.Config.Type.TraceMessage Methods showsPrec :: Int -> TraceMessageElement -> ShowS # show :: TraceMessageElement -> String # showList :: [TraceMessageElement] -> ShowS # | |||||
Eq TraceMessageElement # | TraceMessageElement delimiter | ||||
Defined in Debug.TraceEmbrace.Config.Type.TraceMessage Methods (==) :: TraceMessageElement -> TraceMessageElement -> Bool # (/=) :: TraceMessageElement -> TraceMessageElement -> Bool # | |||||
Lift TraceMessageElement # | |||||
Defined in Debug.TraceEmbrace.Config.Type.TraceMessage Methods lift :: Quote m => TraceMessageElement -> m Exp # liftTyped :: forall (m :: Type -> Type). Quote m => TraceMessageElement -> Code m TraceMessageElement # | |||||
type Rep TraceMessageElement # | |||||
Defined in Debug.TraceEmbrace.Config.Type.TraceMessage type Rep TraceMessageElement = D1 ('MetaData "TraceMessageElement" "Debug.TraceEmbrace.Config.Type.TraceMessage" "trace-embrace-1.2.0-CmI2KHZh5yZHIowi15ioHX" 'False) (((C1 ('MetaCons "LiteralMessage" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Variables" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "FullyQualifiedModule" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ModuleName" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "ShortenJavaModule" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PackageName" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "FunctionName" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "LineNumber" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Delimiter" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))))) |
data TraceMessageFormatG (a :: Type -> Type) #
Constructors
TraceMessageFormat | |
Fields
|
Instances
FromJSON TraceMessageFormat # | |||||||||
Defined in Debug.TraceEmbrace.Config.Type.TraceMessage Methods parseJSON :: Value -> Parser TraceMessageFormat # parseJSONList :: Value -> Parser [TraceMessageFormat] # | |||||||||
FromJSON TraceMessageFormatMaybe # | |||||||||
Defined in Debug.TraceEmbrace.Config.Type.TraceMessage Methods parseJSON :: Value -> Parser TraceMessageFormatMaybe # parseJSONList :: Value -> Parser [TraceMessageFormatMaybe] # | |||||||||
ToJSON TraceMessageFormat # | |||||||||
Defined in Debug.TraceEmbrace.Config.Type.TraceMessage Methods toJSON :: TraceMessageFormat -> Value # toEncoding :: TraceMessageFormat -> Encoding # toJSONList :: [TraceMessageFormat] -> Value # toEncodingList :: [TraceMessageFormat] -> Encoding # omitField :: TraceMessageFormat -> Bool # | |||||||||
ToJSON TraceMessageFormatMaybe # | |||||||||
Defined in Debug.TraceEmbrace.Config.Type.TraceMessage Methods toJSON :: TraceMessageFormatMaybe -> Value # toEncoding :: TraceMessageFormatMaybe -> Encoding # toJSONList :: [TraceMessageFormatMaybe] -> Value # | |||||||||
Semigroup TraceMessageFormatMaybe # | |||||||||
Defined in Debug.TraceEmbrace.Config.Type.TraceMessage Methods (<>) :: TraceMessageFormatMaybe -> TraceMessageFormatMaybe -> TraceMessageFormatMaybe # sconcat :: NonEmpty TraceMessageFormatMaybe -> TraceMessageFormatMaybe # stimes :: Integral b => b -> TraceMessageFormatMaybe -> TraceMessageFormatMaybe # | |||||||||
Generic TraceMessageFormat # | |||||||||
Defined in Debug.TraceEmbrace.Config.Type.TraceMessage Associated Types
Methods from :: TraceMessageFormat -> Rep TraceMessageFormat x # to :: Rep TraceMessageFormat x -> TraceMessageFormat # | |||||||||
Generic TraceMessageFormatMaybe # | |||||||||
Defined in Debug.TraceEmbrace.Config.Type.TraceMessage Methods from :: TraceMessageFormatMaybe -> Rep TraceMessageFormatMaybe x # to :: Rep TraceMessageFormatMaybe x -> TraceMessageFormatMaybe # | |||||||||
Show TraceMessageFormat # | |||||||||
Defined in Debug.TraceEmbrace.Config.Type.TraceMessage Methods showsPrec :: Int -> TraceMessageFormat -> ShowS # show :: TraceMessageFormat -> String # showList :: [TraceMessageFormat] -> ShowS # | |||||||||
Show TraceMessageFormatMaybe # | |||||||||
Defined in Debug.TraceEmbrace.Config.Type.TraceMessage Methods showsPrec :: Int -> TraceMessageFormatMaybe -> ShowS # show :: TraceMessageFormatMaybe -> String # showList :: [TraceMessageFormatMaybe] -> ShowS # | |||||||||
Eq TraceMessageFormat # | |||||||||
Defined in Debug.TraceEmbrace.Config.Type.TraceMessage Methods (==) :: TraceMessageFormat -> TraceMessageFormat -> Bool # (/=) :: TraceMessageFormat -> TraceMessageFormat -> Bool # | |||||||||
Eq TraceMessageFormatMaybe # | |||||||||
Defined in Debug.TraceEmbrace.Config.Type.TraceMessage Methods (==) :: TraceMessageFormatMaybe -> TraceMessageFormatMaybe -> Bool # (/=) :: TraceMessageFormatMaybe -> TraceMessageFormatMaybe -> Bool # | |||||||||
type Rep (TraceMessageFormatG Identity) # | |||||||||
Defined in Debug.TraceEmbrace.Config.Type.TraceMessage type Rep (TraceMessageFormatG Identity) = D1 ('MetaData "TraceMessageFormatG" "Debug.TraceEmbrace.Config.Type.TraceMessage" "trace-embrace-1.2.0-CmI2KHZh5yZHIowi15ioHX" 'False) (C1 ('MetaCons "TraceMessageFormat" 'PrefixI 'True) ((S1 ('MetaSel ('Just "entrySeparator") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Columnar Identity SeparatorValidator String)) :*: S1 ('MetaSel ('Just "keyValueSeparator") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Columnar Identity SeparatorValidator String))) :*: (S1 ('MetaSel ('Just "retValPrefix") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Columnar Identity SeparatorValidator String)) :*: S1 ('MetaSel ('Just "traceLinePattern") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Columnar Identity NonEmpty [TraceMessageElement]))))) | |||||||||
type Rep (TraceMessageFormatG Identity) # | |||||||||
Defined in Debug.TraceEmbrace.Config.Type.TraceMessage type Rep (TraceMessageFormatG Identity) = D1 ('MetaData "TraceMessageFormatG" "Debug.TraceEmbrace.Config.Type.TraceMessage" "trace-embrace-1.2.0-CmI2KHZh5yZHIowi15ioHX" 'False) (C1 ('MetaCons "TraceMessageFormat" 'PrefixI 'True) ((S1 ('MetaSel ('Just "entrySeparator") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Columnar Identity SeparatorValidator String)) :*: S1 ('MetaSel ('Just "keyValueSeparator") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Columnar Identity SeparatorValidator String))) :*: (S1 ('MetaSel ('Just "retValPrefix") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Columnar Identity SeparatorValidator String)) :*: S1 ('MetaSel ('Just "traceLinePattern") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Columnar Identity NonEmpty [TraceMessageElement]))))) |
class MonadIO m => MonadUnliftIO (m :: Type -> Type) #
Monads which allow their actions to be run in IO
.
While MonadIO
allows an IO
action to be lifted into another
monad, this class captures the opposite concept: allowing you to
capture the monadic context. Note that, in order to meet the laws
given below, the intuition is that a monad must have no monadic
state, but may have monadic context. This essentially limits
MonadUnliftIO
to ReaderT
and IdentityT
transformers on top of
IO
.
Laws. For any function run
provided by withRunInIO
, it must meet the
monad transformer laws as reformulated for MonadUnliftIO
:
run . return = return
run (m >>= f) = run m >>= run . f
Instances of MonadUnliftIO
must also satisfy the following laws:
- Identity law
withRunInIO (\run -> run m) = m
- Inverse law
withRunInIO (\_ -> m) = liftIO m
As an example of an invalid instance, a naive implementation of
MonadUnliftIO (StateT s m)
might be
withRunInIO inner = StateT $ \s -> withRunInIO $ \run -> inner (run . flip evalStateT s)
This breaks the identity law because the inner run m
would throw away
any state changes in m
.
Since: unliftio-core-0.1.0.0
Minimal complete definition
Instances
MonadUnliftIO IO # | |
Defined in Control.Monad.IO.Unlift | |
MonadUnliftIO m => MonadUnliftIO (ResourceT m) # | Since: resourcet-1.1.10 |
Defined in Control.Monad.Trans.Resource.Internal | |
MonadUnliftIO m => MonadUnliftIO (IdentityT m) # | |
Defined in Control.Monad.IO.Unlift | |
MonadUnliftIO m => MonadUnliftIO (ReaderT r m) # | |
Defined in Control.Monad.IO.Unlift |
data CompressParams #
The full set of parameters for compression. The defaults are
defaultCompressParams
.
The compressBufferSize
is the size of the first output buffer containing
the compressed data. If you know an approximate upper bound on the size of
the compressed data then setting this parameter can save memory. The default
compression output buffer size is 16k
. If your estimate is wrong it does
not matter too much, the default buffer size will be used for the remaining
chunks.
Constructors
CompressParams | |
Instances
Generic CompressParams # | |||||
Defined in Codec.Compression.Zlib.Internal Associated Types
Methods from :: CompressParams -> Rep CompressParams x # to :: Rep CompressParams x -> CompressParams # | |||||
Show CompressParams # | |||||
Defined in Codec.Compression.Zlib.Internal Methods showsPrec :: Int -> CompressParams -> ShowS # show :: CompressParams -> String # showList :: [CompressParams] -> ShowS # | |||||
Eq CompressParams # | Since: zlib-0.7.0.0 | ||||
Defined in Codec.Compression.Zlib.Internal Methods (==) :: CompressParams -> CompressParams -> Bool # (/=) :: CompressParams -> CompressParams -> Bool # | |||||
Ord CompressParams # | Since: zlib-0.7.0.0 | ||||
Defined in Codec.Compression.Zlib.Internal Methods compare :: CompressParams -> CompressParams -> Ordering # (<) :: CompressParams -> CompressParams -> Bool # (<=) :: CompressParams -> CompressParams -> Bool # (>) :: CompressParams -> CompressParams -> Bool # (>=) :: CompressParams -> CompressParams -> Bool # max :: CompressParams -> CompressParams -> CompressParams # min :: CompressParams -> CompressParams -> CompressParams # | |||||
type Rep CompressParams # | Since: zlib-0.7.0.0 | ||||
Defined in Codec.Compression.Zlib.Internal type Rep CompressParams = D1 ('MetaData "CompressParams" "Codec.Compression.Zlib.Internal" "zlib-0.7.1.0-fXYaPGY85m64i3Jj7klH9" 'False) (C1 ('MetaCons "CompressParams" 'PrefixI 'True) ((S1 ('MetaSel ('Just "compressLevel") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 CompressionLevel) :*: (S1 ('MetaSel ('Just "compressMethod") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Method) :*: S1 ('MetaSel ('Just "compressWindowBits") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 WindowBits))) :*: ((S1 ('MetaSel ('Just "compressMemoryLevel") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 MemoryLevel) :*: S1 ('MetaSel ('Just "compressStrategy") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 CompressionStrategy)) :*: (S1 ('MetaSel ('Just "compressBufferSize") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Int) :*: S1 ('MetaSel ('Just "compressDictionary") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ByteString)))))) |
data DecompressError #
The possible error cases when decompressing a stream.
This can be show
n to give a human readable error message.
Constructors
TruncatedInput | The compressed data stream ended prematurely. This may happen if the input data stream was truncated. |
DictionaryRequired | It is possible to do zlib compression with a custom dictionary. This allows slightly higher compression ratios for short files. However such compressed streams require the same dictionary when decompressing. This error is for when we encounter a compressed stream that needs a dictionary, and it's not provided. |
DictionaryMismatch | If the stream requires a dictionary and you provide one with the
wrong |
DataFormatError String | If the compressed data stream is corrupted in any way then you will
get this error, for example if the input data just isn't a compressed
zlib data stream. In particular if the data checksum turns out to be
wrong then you will get all the decompressed data but this error at the
end, instead of the normal successful |
Instances
Exception DecompressError # | |||||
Defined in Codec.Compression.Zlib.Internal Methods toException :: DecompressError -> SomeException # fromException :: SomeException -> Maybe DecompressError # displayException :: DecompressError -> String # backtraceDesired :: DecompressError -> Bool # | |||||
Generic DecompressError # | |||||
Defined in Codec.Compression.Zlib.Internal Associated Types
Methods from :: DecompressError -> Rep DecompressError x # to :: Rep DecompressError x -> DecompressError # | |||||
Show DecompressError # | |||||
Defined in Codec.Compression.Zlib.Internal Methods showsPrec :: Int -> DecompressError -> ShowS # show :: DecompressError -> String # showList :: [DecompressError] -> ShowS # | |||||
Eq DecompressError # | |||||
Defined in Codec.Compression.Zlib.Internal Methods (==) :: DecompressError -> DecompressError -> Bool # (/=) :: DecompressError -> DecompressError -> Bool # | |||||
Ord DecompressError # | Since: zlib-0.7.0.0 | ||||
Defined in Codec.Compression.Zlib.Internal Methods compare :: DecompressError -> DecompressError -> Ordering # (<) :: DecompressError -> DecompressError -> Bool # (<=) :: DecompressError -> DecompressError -> Bool # (>) :: DecompressError -> DecompressError -> Bool # (>=) :: DecompressError -> DecompressError -> Bool # max :: DecompressError -> DecompressError -> DecompressError # min :: DecompressError -> DecompressError -> DecompressError # | |||||
type Rep DecompressError # | Since: zlib-0.7.0.0 | ||||
Defined in Codec.Compression.Zlib.Internal type Rep DecompressError = D1 ('MetaData "DecompressError" "Codec.Compression.Zlib.Internal" "zlib-0.7.1.0-fXYaPGY85m64i3Jj7klH9" 'False) ((C1 ('MetaCons "TruncatedInput" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DictionaryRequired" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "DictionaryMismatch" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DataFormatError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))) |
data DecompressParams #
The full set of parameters for decompression. The defaults are
defaultDecompressParams
.
The decompressBufferSize
is the size of the first output buffer,
containing the uncompressed data. If you know an exact or approximate upper
bound on the size of the decompressed data then setting this parameter can
save memory. The default decompression output buffer size is 32k
. If your
estimate is wrong it does not matter too much, the default buffer size will
be used for the remaining chunks.
One particular use case for setting the decompressBufferSize
is if you
know the exact size of the decompressed data and want to produce a strict
ByteString
. The compression and decompression functions
use lazy ByteString
s but if you set the
decompressBufferSize
correctly then you can generate a lazy
ByteString
with exactly one chunk, which can be
converted to a strict ByteString
in O(1)
time using
.concat
. toChunks
Constructors
DecompressParams | |
Fields |
Instances
Generic DecompressParams # | |||||
Defined in Codec.Compression.Zlib.Internal Associated Types
Methods from :: DecompressParams -> Rep DecompressParams x # to :: Rep DecompressParams x -> DecompressParams # | |||||
Show DecompressParams # | |||||
Defined in Codec.Compression.Zlib.Internal Methods showsPrec :: Int -> DecompressParams -> ShowS # show :: DecompressParams -> String # showList :: [DecompressParams] -> ShowS # | |||||
Eq DecompressParams # | Since: zlib-0.7.0.0 | ||||
Defined in Codec.Compression.Zlib.Internal Methods (==) :: DecompressParams -> DecompressParams -> Bool # (/=) :: DecompressParams -> DecompressParams -> Bool # | |||||
Ord DecompressParams # | Since: zlib-0.7.0.0 | ||||
Defined in Codec.Compression.Zlib.Internal Methods compare :: DecompressParams -> DecompressParams -> Ordering # (<) :: DecompressParams -> DecompressParams -> Bool # (<=) :: DecompressParams -> DecompressParams -> Bool # (>) :: DecompressParams -> DecompressParams -> Bool # (>=) :: DecompressParams -> DecompressParams -> Bool # max :: DecompressParams -> DecompressParams -> DecompressParams # min :: DecompressParams -> DecompressParams -> DecompressParams # | |||||
type Rep DecompressParams # | Since: zlib-0.7.0.0 | ||||
Defined in Codec.Compression.Zlib.Internal type Rep DecompressParams = D1 ('MetaData "DecompressParams" "Codec.Compression.Zlib.Internal" "zlib-0.7.1.0-fXYaPGY85m64i3Jj7klH9" 'False) (C1 ('MetaCons "DecompressParams" 'PrefixI 'True) ((S1 ('MetaSel ('Just "decompressWindowBits") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 WindowBits) :*: S1 ('MetaSel ('Just "decompressBufferSize") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "decompressDictionary") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ByteString)) :*: S1 ('MetaSel ('Just "decompressAllMembers") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))) |
newtype CompressionLevel #
The compression level parameter controls the amount of compression. This is a trade-off between the amount of compression and the time required to do the compression.
Constructors
CompressionLevel Int |
Instances
Generic CompressionLevel # | |||||
Defined in Codec.Compression.Zlib.Stream Associated Types
Methods from :: CompressionLevel -> Rep CompressionLevel x # to :: Rep CompressionLevel x -> CompressionLevel # | |||||
Show CompressionLevel # | |||||
Defined in Codec.Compression.Zlib.Stream Methods showsPrec :: Int -> CompressionLevel -> ShowS # show :: CompressionLevel -> String # showList :: [CompressionLevel] -> ShowS # | |||||
Eq CompressionLevel # | |||||
Defined in Codec.Compression.Zlib.Stream Methods (==) :: CompressionLevel -> CompressionLevel -> Bool # (/=) :: CompressionLevel -> CompressionLevel -> Bool # | |||||
Ord CompressionLevel # | Since: zlib-0.7.0.0 | ||||
Defined in Codec.Compression.Zlib.Stream Methods compare :: CompressionLevel -> CompressionLevel -> Ordering # (<) :: CompressionLevel -> CompressionLevel -> Bool # (<=) :: CompressionLevel -> CompressionLevel -> Bool # (>) :: CompressionLevel -> CompressionLevel -> Bool # (>=) :: CompressionLevel -> CompressionLevel -> Bool # max :: CompressionLevel -> CompressionLevel -> CompressionLevel # min :: CompressionLevel -> CompressionLevel -> CompressionLevel # | |||||
type Rep CompressionLevel # | |||||
Defined in Codec.Compression.Zlib.Stream type Rep CompressionLevel = D1 ('MetaData "CompressionLevel" "Codec.Compression.Zlib.Stream" "zlib-0.7.1.0-fXYaPGY85m64i3Jj7klH9" 'True) (C1 ('MetaCons "CompressionLevel" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))) |