polysemy-resume-0.7.0.0: Polysemy error tracking
Safe HaskellSafe-Inferred
LanguageHaskell2010

Polysemy.Resume.Interpreter.Scoped

Description

 
Synopsis

Documentation

interpretScopedResumableH :: forall param resource effect err r. (forall q x. param -> (resource -> Sem (Stop err ': (Opaque q ': r)) x) -> Sem (Stop err ': (Opaque q ': r)) x) -> (forall q r0 x. resource -> effect (Sem r0) x -> Tactical effect (Sem r0) (Stop err ': (Opaque q ': r)) x) -> InterpreterFor (Scoped param effect !! err) r Source #

Combined higher-order interpreter for Scoped and Resumable. This allows Stop to be sent from within the resource allocator so that the consumer receives it, terminating the entire scope.

interpretScopedResumable :: forall param resource effect err r. (forall q x. param -> (resource -> Sem (Stop err ': (Opaque q ': r)) x) -> Sem (Stop err ': (Opaque q ': r)) x) -> (forall q r0 x. resource -> effect (Sem r0) x -> Sem (Stop err ': (Opaque q ': r)) x) -> InterpreterFor (Scoped param effect !! err) r Source #

Combined interpreter for Scoped and Resumable. This allows Stop to be sent from within the resource allocator so that the consumer receives it, terminating the entire scope.

interpretScopedResumable_ :: forall param resource effect err r. (forall q. param -> Sem (Stop err ': (Opaque q ': r)) resource) -> (forall q r0 x. resource -> effect (Sem r0) x -> Sem (Stop err ': (Opaque q ': r)) x) -> InterpreterFor (Scoped param effect !! err) r Source #

Combined interpreter for Scoped and Resumable. This allows Stop to be sent from within the resource allocator so that the consumer receives it, terminating the entire scope. In this variant, the resource allocator is a plain action.

interpretScopedResumableWithH :: forall extra param resource effect err r. KnownList extra => (forall q x. param -> (resource -> Sem (extra ++ (Stop err ': (Opaque q ': r))) x) -> Sem (Stop err ': (Opaque q ': r)) x) -> (forall q r0 x. resource -> effect (Sem r0) x -> Tactical effect (Sem r0) (extra ++ ([Stop err, Opaque q] ++ r)) x) -> InterpreterFor (Scoped param effect !! err) r Source #

Combined higher-order interpreter for Scoped and Resumable that allows the handler to use additional effects that are interpreted by the resource allocator. This allows Stop to be sent from within the resource allocator so that the consumer receives it, terminating the entire scope.

interpretScopedResumableWith :: forall extra param resource effect err r. KnownList extra => (forall q x. param -> (resource -> Sem (extra ++ (Stop err ': (Opaque q ': r))) x) -> Sem (Stop err ': (Opaque q ': r)) x) -> (forall q r0 x. resource -> effect (Sem r0) x -> Sem (extra ++ (Stop err ': (Opaque q ': r))) x) -> InterpreterFor (Scoped param effect !! err) r Source #

Combined interpreter for Scoped and Resumable that allows the handler to use additional effects that are interpreted by the resource allocator. This allows Stop to be sent from within the resource allocator so that the consumer receives it, terminating the entire scope.

interpretScopedResumableWith_ :: forall extra param effect err r. KnownList extra => (forall q x. param -> Sem (extra ++ (Stop err ': (Opaque q ': r))) x -> Sem (Stop err ': (Opaque q ': r)) x) -> (forall q r0 x. effect (Sem r0) x -> Sem (extra ++ (Stop err ': (Opaque q ': r))) x) -> InterpreterFor (Scoped param effect !! err) r Source #

Combined interpreter for Scoped and Resumable that allows the handler to use additional effects that are interpreted by the resource allocator. This allows Stop to be sent from within the resource allocator so that the consumer receives it, terminating the entire scope. In this variant, no resource is used and the allocator is a plain interpreter.

interpretResumableScopedH :: forall param resource effect err r. (forall q x. param -> (resource -> Sem (Opaque q ': r) x) -> Sem (Opaque q ': r) x) -> (forall q r0 x. resource -> effect (Sem r0) x -> Tactical (effect !! err) (Sem r0) (Stop err ': (Opaque q ': r)) x) -> InterpreterFor (Scoped param (effect !! err)) r Source #

Combined higher-order interpreter for Resumable and Scoped. In this variant, only the handler may send Stop, but this allows resumption to happen on each action inside of the scope.

interpretResumableScoped :: forall param resource effect err r. (forall q x. param -> (resource -> Sem (Opaque q ': r) x) -> Sem (Opaque q ': r) x) -> (forall q r0 x. resource -> effect (Sem r0) x -> Sem (Stop err ': (Opaque q ': r)) x) -> InterpreterFor (Scoped param (effect !! err)) r Source #

Combined interpreter for Resumable and Scoped. In this variant, only the handler may send Stop, but this allows resumption to happen on each action inside of the scope.

interpretResumableScoped_ :: forall param resource effect err r. (param -> Sem r resource) -> (forall q r0 x. resource -> effect (Sem r0) x -> Sem (Stop err ': (Opaque q ': r)) x) -> InterpreterFor (Scoped param (effect !! err)) r Source #

Combined interpreter for Resumable and Scoped. In this variant: - Only the handler may send Stop, but this allows resumption to happen on each action inside of the scope. - The resource allocator is a plain action.

interpretResumableScopedWithH :: forall extra param resource effect err r. KnownList extra => (forall q x. param -> (resource -> Sem (extra ++ (Opaque q ': r)) x) -> Sem (Opaque q ': r) x) -> (forall q r0 x. resource -> effect (Sem r0) x -> Tactical (effect !! err) (Sem r0) (Stop err ': (extra ++ (Opaque q ': r))) x) -> InterpreterFor (Scoped param (effect !! err)) r Source #

Combined higher-order interpreter for Resumable and Scoped that allows the handler to use additional effects that are interpreted by the resource allocator. In this variant, only the handler may send Stop, but this allows resumption to happen on each action inside of the scope.

interpretResumableScopedWith :: forall extra param resource effect err r. KnownList extra => (forall q x. param -> (resource -> Sem (extra ++ (Opaque q ': r)) x) -> Sem (Opaque q ': r) x) -> (forall r0 x. resource -> effect (Sem r0) x -> Sem (Stop err ': (extra ++ r)) x) -> InterpreterFor (Scoped param (effect !! err)) r Source #

Combined interpreter for Resumable and Scoped that allows the handler to use additional effects that are interpreted by the resource allocator. In this variant, only the handler may send Stop, but this allows resumption to happen on each action inside of the scope.

interpretResumableScopedWith_ :: forall extra param effect err r. KnownList extra => (forall q x. param -> Sem (extra ++ (Opaque q ': r)) x -> Sem (Opaque q ': r) x) -> (forall r0 x. effect (Sem r0) x -> Sem (Stop err ': (extra ++ r)) x) -> InterpreterFor (Scoped param (effect !! err)) r Source #

Combined interpreter for Resumable and Scoped that allows the handler to use additional effects that are interpreted by the resource allocator. In this variant: - Only the handler may send Stop, but this allows resumption to happen on each action inside of the scope. - No resource is used and the allocator is a plain interpreter.

interpretScopedRH :: forall param resource effect eo ei r. (forall q x. param -> (resource -> Sem (Stop eo ': (Opaque q ': r)) x) -> Sem (Stop eo ': (Opaque q ': r)) x) -> (forall q r0 x. resource -> effect (Sem r0) x -> Tactical (effect !! ei) (Sem r0) (Stop ei ': (Stop eo ': (Opaque q ': r))) x) -> InterpreterFor (Scoped param (effect !! ei) !! eo) r Source #

Combined higher-order interpreter for Resumable and Scoped. In this variant, both the handler and the scope may send different errors via Stop, encoding the concept that the resource allocation may fail to prevent the scope from being executed, and each individual scoped action may fail, continuing the scope execution on resumption.

interpretScopedR :: forall param resource effect eo ei r. (forall q x. param -> (resource -> Sem (Stop eo ': (Opaque q ': r)) x) -> Sem (Stop eo ': (Opaque q ': r)) x) -> (forall q r0 x. resource -> effect (Sem r0) x -> Sem (Stop ei ': (Stop eo ': (Opaque q ': r))) x) -> InterpreterFor (Scoped param (effect !! ei) !! eo) r Source #

Combined interpreter for Scoped and Resumable. In this variant, both the handler and the scope may send different errors via Stop, encoding the concept that the resource allocation may fail to prevent the scope from being executed, and each individual scoped action may fail, continuing the scope execution on resumption.

interpretScopedR_ :: forall param resource effect eo ei r. (param -> Sem (Stop eo ': r) resource) -> (forall q r0 x. resource -> effect (Sem r0) x -> Sem (Stop ei ': (Stop eo ': (Opaque q ': r))) x) -> InterpreterFor (Scoped param (effect !! ei) !! eo) r Source #

Combined interpreter for Scoped and Resumable. In this variant: - Both the handler and the scope may send different errors via Stop, encoding the concept that the resource allocation may fail to prevent the scope from being executed, and each individual scoped action may fail, continuing the scope execution on resumption. - The resource allocator is a plain action.

interpretScopedRWithH :: forall extra param resource effect eo ei r. KnownList extra => (forall q x. param -> (resource -> Sem (extra ++ (Stop eo ': (Opaque q ': r))) x) -> Sem (Stop eo ': (Opaque q ': r)) x) -> (forall q r0 x. resource -> effect (Sem r0) x -> Tactical (effect !! ei) (Sem r0) (Stop ei ': (extra ++ (Stop eo ': (Opaque q ': r)))) x) -> InterpreterFor (Scoped param (effect !! ei) !! eo) r Source #

Combined higher-order interpreter for Scoped and Resumable that allows the handler to use additional effects that are interpreted by the resource allocator. In this variant, both the handler and the scope may send different errors via Stop, encoding the concept that the resource allocation may fail to prevent the scope from being executed, and each individual scoped action may fail, continuing the scope execution on resumption.

interpretScopedRWith :: forall extra param resource effect eo ei r. KnownList extra => (forall q x. param -> (resource -> Sem (extra ++ (Stop eo ': (Opaque q ': r))) x) -> Sem (Stop eo ': (Opaque q ': r)) x) -> (forall q r0 x. resource -> effect (Sem r0) x -> Sem (Stop ei ': (extra ++ (Stop eo ': (Opaque q ': r)))) x) -> InterpreterFor (Scoped param (effect !! ei) !! eo) r Source #

Combined interpreter for Scoped and Resumable that allows the handler to use additional effects that are interpreted by the resource allocator. In this variant, both the handler and the scope may send different errors via Stop, encoding the concept that the resource allocation may fail to prevent the scope from being executed, and each individual scoped action may fail, continuing the scope execution on resumption.

interpretScopedRWith_ :: forall extra param effect eo ei r. KnownList extra => (forall q x. param -> Sem (extra ++ (Stop eo ': (Opaque q ': r))) x -> Sem (Stop eo ': (Opaque q ': r)) x) -> (forall q r0 x. effect (Sem r0) x -> Sem (Stop ei ': (extra ++ (Stop eo ': (Opaque q ': r)))) x) -> InterpreterFor (Scoped param (effect !! ei) !! eo) r Source #

Combined interpreter for Scoped and Resumable that allows the handler to use additional effects that are interpreted by the resource allocator. - Both the handler and the scope may send different errors via Stop, encoding the concept that the resource allocation may fail to prevent the scope from being executed, and each individual scoped action may fail, continuing the scope execution on resumption. - The resource allocator is a plain action.