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

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

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

ArrowError ex (Diagram ex :: Type -> Type -> Type) Source # | |

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

Defined in Control.Arrow.Free 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 # | |

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

ArrowError ex arr => ArrowError ex (AppArrow (Reader r) arr :: Type -> Type -> Type) 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