componentm-0.0.0.2: Monad for allocation and cleanup of application resources
Safe HaskellNone
LanguageHaskell2010

Control.Monad.Component.Internal.Types

Synopsis

Documentation

data ComponentError Source #

Exception thrown by the runComponentM family of functions

Constructors

ComponentRuntimeFailed

Failure raised when the Application Callback given to a runComponentM function throws an exception

Fields

ComponentBuildFailed

Failure raised when execution of ComponentM throws an exception

Fields

Instances

Instances details
Exception ComponentError Source # 
Instance details

Defined in Control.Monad.Component.Internal.Types

Generic ComponentError Source # 
Instance details

Defined in Control.Monad.Component.Internal.Types

Associated Types

type Rep ComponentError 
Instance details

Defined in Control.Monad.Component.Internal.Types

type Rep ComponentError = D1 ('MetaData "ComponentError" "Control.Monad.Component.Internal.Types" "componentm-0.0.0.2-8ebyItofbp51gUDrplwObq" 'False) (C1 ('MetaCons "ComponentRuntimeFailed" 'PrefixI 'True) (S1 ('MetaSel ('Just "componentErrorOriginalException") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SomeException) :*: S1 ('MetaSel ('Just "componentErrorTeardownResult") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TeardownResult)) :+: C1 ('MetaCons "ComponentBuildFailed" 'PrefixI 'True) (S1 ('MetaSel ('Just "componentErrorBuildErrors") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [ComponentBuildError]) :*: S1 ('MetaSel ('Just "componentErrorTeardownResult") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TeardownResult)))
Show ComponentError Source # 
Instance details

Defined in Control.Monad.Component.Internal.Types

Pretty ComponentError Source # 
Instance details

Defined in Control.Monad.Component.Internal.Types

Methods

pretty :: ComponentError -> Doc ann #

prettyList :: [ComponentError] -> Doc ann #

type Rep ComponentError Source # 
Instance details

Defined in Control.Monad.Component.Internal.Types

type Rep ComponentError = D1 ('MetaData "ComponentError" "Control.Monad.Component.Internal.Types" "componentm-0.0.0.2-8ebyItofbp51gUDrplwObq" 'False) (C1 ('MetaCons "ComponentRuntimeFailed" 'PrefixI 'True) (S1 ('MetaSel ('Just "componentErrorOriginalException") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SomeException) :*: S1 ('MetaSel ('Just "componentErrorTeardownResult") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TeardownResult)) :+: C1 ('MetaCons "ComponentBuildFailed" 'PrefixI 'True) (S1 ('MetaSel ('Just "componentErrorBuildErrors") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [ComponentBuildError]) :*: S1 ('MetaSel ('Just "componentErrorTeardownResult") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TeardownResult)))

data ComponentBuildError Source #

Exception raised on the execution of IO sub-routines used when constructing ComponentM values (e.g. buildComponent)

Constructors

DuplicatedComponentKeyDetected !Description

Failure thrown when using the same component key on a Component composition

ComponentAllocationFailed !Description !SomeException

Failure thrown when the allocation sub-routine of a Component fails with an exception

ComponentErrorThrown !SomeException

Failure thrown when calling the throwM when composing ComponentM values

ComponentIOLiftFailed !SomeException

Failure thrown when calling liftIO fails with an exception

newtype ComponentM a Source #

Represents the construction of a Component in your application, components may be composed using a Monad or Applicative interface.

Constructors

ComponentM (IO (Either ([ComponentBuildError], BuildTable) (a, BuildTable))) 

Instances

Instances details
MonadIO ComponentM Source # 
Instance details

Defined in Control.Monad.Component.Internal.Types

Methods

liftIO :: IO a -> ComponentM a #

Applicative ComponentM Source # 
Instance details

Defined in Control.Monad.Component.Internal.Types

Methods

pure :: a -> ComponentM a #

(<*>) :: ComponentM (a -> b) -> ComponentM a -> ComponentM b #

liftA2 :: (a -> b -> c) -> ComponentM a -> ComponentM b -> ComponentM c #

(*>) :: ComponentM a -> ComponentM b -> ComponentM b #

(<*) :: ComponentM a -> ComponentM b -> ComponentM a #

Functor ComponentM Source # 
Instance details

Defined in Control.Monad.Component.Internal.Types

Methods

fmap :: (a -> b) -> ComponentM a -> ComponentM b #

(<$) :: a -> ComponentM b -> ComponentM a #

Monad ComponentM Source # 
Instance details

Defined in Control.Monad.Component.Internal.Types

Methods

(>>=) :: ComponentM a -> (a -> ComponentM b) -> ComponentM b #

(>>) :: ComponentM a -> ComponentM b -> ComponentM b #

return :: a -> ComponentM a #

MonadThrow ComponentM Source # 
Instance details

Defined in Control.Monad.Component.Internal.Types

Methods

throwM :: (HasCallStack, Exception e) => e -> ComponentM a #

data Build Source #

Contains metadata about the build of a resource from a ComponentM value

Constructors

Build 

Fields

Instances

Instances details
Generic Build Source # 
Instance details

Defined in Control.Monad.Component.Internal.Types

Associated Types

type Rep Build 
Instance details

Defined in Control.Monad.Component.Internal.Types

type Rep Build

Methods

from :: Build -> Rep Build x #

to :: Rep Build x -> Build #

Pretty Build Source # 
Instance details

Defined in Control.Monad.Component.Internal.Types

Methods

pretty :: Build -> Doc ann #

prettyList :: [Build] -> Doc ann #

Display Build Source # 
Instance details

Defined in Control.Monad.Component.Internal.Types

type Rep Build Source # 
Instance details

Defined in Control.Monad.Component.Internal.Types

type Rep Build

newtype BuildResult Source #

Wraps a collection of Build records

Constructors

BuildResult 

Fields

Instances

Instances details
Pretty BuildResult Source # 
Instance details

Defined in Control.Monad.Component.Internal.Types

Methods

pretty :: BuildResult -> Doc ann #

prettyList :: [BuildResult] -> Doc ann #

Display BuildResult Source # 
Instance details

Defined in Control.Monad.Component.Internal.Types

data TeardownResult #

Result from a Teardown sub-routine

Instances

Instances details
Generic TeardownResult 
Instance details

Defined in Control.Teardown.Internal.Types

Associated Types

type Rep TeardownResult 
Instance details

Defined in Control.Teardown.Internal.Types

type Rep TeardownResult = D1 ('MetaData "TeardownResult" "Control.Teardown.Internal.Types" "teardown-0.5.0.1-9GJ80OpyLuCGUTCK1lrWyY" 'False) (C1 ('MetaCons "BranchResult" 'PrefixI 'True) ((S1 ('MetaSel ('Just "resultDescription") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Description) :*: S1 ('MetaSel ('Just "resultElapsedTime") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NominalDiffTime)) :*: (S1 ('MetaSel ('Just "resultDidFail") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just "resultListing") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [TeardownResult]))) :+: (C1 ('MetaCons "LeafResult" 'PrefixI 'True) (S1 ('MetaSel ('Just "resultDescription") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Description) :*: (S1 ('MetaSel ('Just "resultElapsedTime") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NominalDiffTime) :*: S1 ('MetaSel ('Just "resultError") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe SomeException)))) :+: C1 ('MetaCons "EmptyResult" 'PrefixI 'True) (S1 ('MetaSel ('Just "resultDescription") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Description))))
Show TeardownResult 
Instance details

Defined in Control.Teardown.Internal.Types

NFData TeardownResult 
Instance details

Defined in Control.Teardown.Internal.Types

Methods

rnf :: TeardownResult -> () #

Pretty TeardownResult 
Instance details

Defined in Control.Teardown.Internal.Types

Methods

pretty :: TeardownResult -> Doc ann #

prettyList :: [TeardownResult] -> Doc ann #

Display TeardownResult 
Instance details

Defined in Control.Teardown.Internal.Types

type Rep TeardownResult 
Instance details

Defined in Control.Teardown.Internal.Types

type Rep TeardownResult = D1 ('MetaData "TeardownResult" "Control.Teardown.Internal.Types" "teardown-0.5.0.1-9GJ80OpyLuCGUTCK1lrWyY" 'False) (C1 ('MetaCons "BranchResult" 'PrefixI 'True) ((S1 ('MetaSel ('Just "resultDescription") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Description) :*: S1 ('MetaSel ('Just "resultElapsedTime") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NominalDiffTime)) :*: (S1 ('MetaSel ('Just "resultDidFail") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just "resultListing") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [TeardownResult]))) :+: (C1 ('MetaCons "LeafResult" 'PrefixI 'True) (S1 ('MetaSel ('Just "resultDescription") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Description) :*: (S1 ('MetaSel ('Just "resultElapsedTime") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NominalDiffTime) :*: S1 ('MetaSel ('Just "resultError") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe SomeException)))) :+: C1 ('MetaCons "EmptyResult" 'PrefixI 'True) (S1 ('MetaSel ('Just "resultDescription") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Description))))

data ComponentEvent Source #

An event record used to trace the execution of an application initialization and teardown