funflow-1.5.0: Workflows with arrows

Safe HaskellSafe
LanguageHaskell2010

Control.Arrow.Free

Contents

Description

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

Documentation

data Free eff a b Source #

Freely generated arrows over an effect.

Instances
Arrow (Free eff) Source # 
Instance details

Defined in Control.Arrow.Free

Methods

arr :: (b -> c) -> Free eff b c #

first :: Free eff b c -> Free eff (b, d) (c, d) #

second :: Free eff b c -> Free eff (d, b) (d, c) #

(***) :: Free eff b c -> Free eff b' c' -> Free eff (b, b') (c, c') #

(&&&) :: Free eff b c -> Free eff b c' -> Free eff b (c, c') #

Category (Free eff :: Type -> Type -> Type) Source # 
Instance details

Defined in Control.Arrow.Free

Methods

id :: Free eff a a #

(.) :: Free eff b c -> Free eff a b -> Free eff a c #

data Choice eff a b Source #

Freely generated ArrowChoice over an effect.

Instances
Arrow (Choice eff) Source # 
Instance details

Defined in Control.Arrow.Free

Methods

arr :: (b -> c) -> Choice eff b c #

first :: Choice eff b c -> Choice eff (b, d) (c, d) #

second :: Choice eff b c -> Choice eff (d, b) (d, c) #

(***) :: Choice eff b c -> Choice eff b' c' -> Choice eff (b, b') (c, c') #

(&&&) :: Choice eff b c -> Choice eff b c' -> Choice eff b (c, c') #

ArrowChoice (Choice eff) Source # 
Instance details

Defined in Control.Arrow.Free

Methods

left :: Choice eff b c -> Choice eff (Either b d) (Either c d) #

right :: Choice eff b c -> Choice eff (Either d b) (Either d c) #

(+++) :: Choice eff b c -> Choice eff b' c' -> Choice eff (Either b b') (Either c c') #

(|||) :: Choice eff b d -> Choice eff c d -> Choice eff (Either b c) d #

Category (Choice eff :: Type -> Type -> Type) Source # 
Instance details

Defined in Control.Arrow.Free

Methods

id :: Choice eff a a #

(.) :: Choice eff b c -> Choice eff a b -> Choice eff a c #

data ErrorChoice ex eff a b Source #

Freely generated arrows with both choice and error handling.

Instances
ArrowFlow eff ex (Flow eff ex) Source # 
Instance details

Defined in Control.Funflow.Class

Methods

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 :: Type -> Type -> Type) Source # 
Instance details

Defined in Control.Arrow.Free

Methods

try :: ErrorChoice ex eff e c -> ErrorChoice ex eff e (Either ex c) Source #

Category (ErrorChoice ex eff :: Type -> Type -> Type) Source # 
Instance details

Defined in Control.Arrow.Free

Methods

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 # 
Instance details

Defined in Control.Arrow.Free

Methods

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 # 
Instance details

Defined in Control.Arrow.Free

Methods

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 #

effect :: FreeArrowLike fal => eff a b -> fal eff a b Source #

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.

Methods

try :: a e c -> a e (Either ex c) Source #

Instances
(Arrow (Kleisli m), Exception ex, MonadCatch m) => ArrowError ex (Kleisli m :: Type -> Type -> Type) Source # 
Instance details

Defined in Control.Arrow.Free

Methods

try :: Kleisli m e c -> Kleisli m e (Either ex c) Source #

(Exception ex, MonadBaseControl IO m, MonadCatch m) => ArrowError ex (AsyncA m :: Type -> Type -> Type) Source # 
Instance details

Defined in Control.Arrow.Async

Methods

try :: AsyncA m e c -> AsyncA m e (Either ex c) Source #

ArrowError ex (Diagram ex :: Type -> Type -> Type) Source # 
Instance details

Defined in Control.Funflow.Diagram

Methods

try :: Diagram ex e c -> Diagram ex e (Either ex c) Source #

ArrowError ex (ErrorChoice ex eff :: Type -> Type -> Type) Source # 
Instance details

Defined in Control.Arrow.Free

Methods

try :: ErrorChoice ex eff e c -> ErrorChoice ex eff e (Either ex c) Source #

(ArrowError ex arr, Monoid w) => ArrowError ex (AppArrow (Writer w) arr :: Type -> Type -> Type) Source # 
Instance details

Defined in Control.Arrow.Free

Methods

try :: AppArrow (Writer w) arr e c -> AppArrow (Writer w) arr e (Either ex c) Source #

(ArrowError ex arr, Monoid w) => ArrowError ex (AppArrow (Writer w) arr :: Type -> Type -> Type) Source # 
Instance details

Defined in Control.Arrow.Free

Methods

try :: AppArrow (Writer w) arr e c -> AppArrow (Writer w) arr e (Either ex c) Source #

ArrowError ex arr => ArrowError ex (AppArrow (Reader r) arr :: Type -> Type -> Type) Source # 
Instance details

Defined in Control.Arrow.Free

Methods

try :: AppArrow (Reader r) arr e c -> AppArrow (Reader r) arr e (Either ex c) Source #

catch :: (ArrowError ex a, ArrowChoice a) => a e c -> a (e, ex) c -> a 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

type (~>) x y = forall a b. x a b -> y a b Source #

A natural transformation on type constructors of two arguments.