Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Various varieties of free arrow constructions.
For all of these constructions, there are only two important functions:
- eval
evaluates the free arrow in the context of another arrow.
- effect
lifts the underlying effect into the arrow.
The class FreeArrowLike
, which is not exported from this module, exists
to allow these to be defined generally.
This module also defines some arrow combinators which are not exposed by the standard arrow library.
Synopsis
- data Free eff a b
- data Choice eff a b
- data ErrorChoice ex eff a b
- effect :: FreeArrowLike fal => eff a b -> fal eff a b
- eval :: forall eff arr a b. (FreeArrowLike fal, Ctx fal arr) => (eff ~> arr) -> fal eff a b -> arr a b
- class ArrowError ex a where
- mapA :: ArrowChoice a => a b c -> a [b] [c]
- mapSeqA :: ArrowChoice a => a b c -> a [b] [c]
- filterA :: ArrowChoice a => a b Bool -> a [b] [b]
- type (~>) x y = forall a b. x a b -> y a b
Documentation
Freely generated arrows over an effect.
Freely generated ArrowChoice
over an effect.
data ErrorChoice ex eff a b Source #
Freely generated arrows with both choice and error handling.
Instances
ArrowFlow eff ex (Flow eff ex) Source # | |
Defined in Control.Funflow.Class step' :: Properties a b -> (a -> b) -> Flow eff ex a b Source # stepIO' :: Properties a b -> (a -> IO b) -> Flow eff ex a b Source # external :: (a -> ExternalTask) -> Flow eff ex a Item Source # external' :: ExternalProperties a -> (a -> ExternalTask) -> Flow eff ex a Item Source # wrap' :: Properties a b -> eff a b -> Flow eff ex a b Source # putInStore :: ContentHashable IO a => (Path Abs Dir -> a -> IO ()) -> Flow eff ex a Item Source # getFromStore :: (Path Abs t -> IO a) -> Flow eff ex (Content t) a Source # internalManipulateStore :: (ContentStore -> a -> IO b) -> Flow eff ex a b Source # | |
ArrowError ex (ErrorChoice ex eff :: * -> * -> *) Source # | |
Defined in Control.Arrow.Free catch :: ErrorChoice ex eff e c -> ErrorChoice ex eff (e, ex) c -> ErrorChoice ex eff e c Source # | |
Category (ErrorChoice ex eff :: * -> * -> *) Source # | |
Defined in Control.Arrow.Free id :: ErrorChoice ex eff a a # (.) :: ErrorChoice ex eff b c -> ErrorChoice ex eff a b -> ErrorChoice ex eff a c # | |
Arrow (ErrorChoice ex eff) Source # | |
Defined in Control.Arrow.Free arr :: (b -> c) -> ErrorChoice ex eff b c # first :: ErrorChoice ex eff b c -> ErrorChoice ex eff (b, d) (c, d) # second :: ErrorChoice ex eff b c -> ErrorChoice ex eff (d, b) (d, c) # (***) :: ErrorChoice ex eff b c -> ErrorChoice ex eff b' c' -> ErrorChoice ex eff (b, b') (c, c') # (&&&) :: ErrorChoice ex eff b c -> ErrorChoice ex eff b c' -> ErrorChoice ex eff b (c, c') # | |
ArrowChoice (ErrorChoice ex eff) Source # | |
Defined in Control.Arrow.Free left :: ErrorChoice ex eff b c -> ErrorChoice ex eff (Either b d) (Either c d) # right :: ErrorChoice ex eff b c -> ErrorChoice ex eff (Either d b) (Either d c) # (+++) :: ErrorChoice ex eff b c -> ErrorChoice ex eff b' c' -> ErrorChoice ex eff (Either b b') (Either c c') # (|||) :: ErrorChoice ex eff b d -> ErrorChoice ex eff c d -> ErrorChoice ex eff (Either b c) d # |
eval :: forall eff arr a b. (FreeArrowLike fal, Ctx fal arr) => (eff ~> arr) -> fal eff a b -> arr a b Source #
ArrowError
class ArrowError ex a where Source #
ArrowError represents those arrows which can catch exceptions within the processing of the flow.
Instances
(Arrow (Kleisli m), Exception ex, MonadCatch m) => ArrowError ex (Kleisli m :: * -> * -> *) Source # | |
(Exception ex, MonadBaseControl IO m, MonadCatch m) => ArrowError ex (AsyncA m :: * -> * -> *) Source # | |
ArrowError ex (Diagram ex :: * -> * -> *) Source # | |
ArrowError ex (ErrorChoice ex eff :: * -> * -> *) Source # | |
Defined in Control.Arrow.Free catch :: ErrorChoice ex eff e c -> ErrorChoice ex eff (e, ex) c -> ErrorChoice ex eff e c Source # |
Arrow functions
mapA :: ArrowChoice a => a b c -> a [b] [c] Source #
Map an arrow over a list.
mapSeqA :: ArrowChoice a => a b c -> a [b] [c] Source #
Map an arrow over a list, forcing sequencing between each element.
filterA :: ArrowChoice a => a b Bool -> a [b] [b] Source #
Filter a list given an arrow filter