Safe Haskell | Safe-Infered |
---|

- class Arrow ~> => ArrowF f (~>) | ~> -> f where
- mapF :: ArrowF f ~> => (f b -> f c) -> (a ~> b) -> a ~> c
- arrMF :: (ArrowF f ~>, ArrowKleisli m ~>) => (a -> m (f c)) -> a ~> c
- unite :: ArrowPlus ~> => (b, b) ~> b
- const :: Arrow ~> => b -> a ~> b
- concatA :: ArrowPlus ~> => [a ~> b] -> a ~> b
- plus :: (Alternative f, ArrowF f ~>) => (a ~> b) -> (a ~> b) -> a ~> b
- constF :: ArrowF f ~> => f c -> a ~> c
- none :: (Alternative f, ArrowF f ~>) => a ~> b
- results :: (Foldable f, ArrowF f ~>) => (a ~> b) -> a ~> Bool
- isA :: (Alternative f, ArrowF f ~>) => (a -> Bool) -> a ~> a
- ifA :: (Foldable f, ArrowF f ~>, ArrowChoice ~>) => (a ~> b) -> (a ~> t) -> (a ~> t) -> a ~> t
- when :: (Foldable f, ArrowF f ~>, ArrowChoice ~>) => (a ~> a) -> (a ~> c) -> a ~> a
- guards :: (Alternative f, Foldable f, ArrowF f ~>, ArrowChoice ~>) => (a ~> c) -> (a ~> b) -> a ~> b
- filterA :: (Alternative f, Foldable f, ArrowF f ~>, ArrowChoice ~>) => (a ~> c) -> a ~> a
- notA :: (Alternative f, Foldable f, ArrowF f ~>, ArrowChoice ~>) => (a ~> c) -> a ~> a
- orElse :: (Foldable f, ArrowF f ~>, ArrowChoice ~>) => (a ~> b) -> (a ~> b) -> a ~> b
- maybeA :: (Alternative f, ArrowF f ~>) => Maybe a ~> a
- optional :: (Foldable f, ArrowF f ~>, ArrowChoice ~>) => (a ~> b) -> a ~> Maybe b

# Container arrow type class.

class Arrow ~> => ArrowF f (~>) | ~> -> f whereSource

A type class for arrows that produce containers of results. The container
arrow can be seen as a generalization for list arrows. Most operations
assume the container type has an `Applicative`

, an `Alternative`

and a
`Foldable`

instance.

:: f a ~> a | Use a container as the input for an arrow. |

:: (a ~> b) | |

-> a ~> f b | Get the result as container. |

mapF :: ArrowF f ~> => (f b -> f c) -> (a ~> b) -> a ~> cSource

Map a function over the result collection of a container arrow.

arrMF :: (ArrowF f ~>, ArrowKleisli m ~>) => (a -> m (f c)) -> a ~> cSource

Embed a monadic function returning an ordered list into a container arrow.

# Generic arrow utilities.

unite :: ArrowPlus ~> => (b, b) ~> bSource

Take the output of an arrow producing two results and concatenate them into the result of the container arrow.

concatA :: ArrowPlus ~> => [a ~> b] -> a ~> bSource

Collect the results of applying multiple arrows to the same input.

plus :: (Alternative f, ArrowF f ~>) => (a ~> b) -> (a ~> b) -> a ~> bSource

Join the results of two arrows, like (+) from ArrowPlus.

# Container arrow utilities.

constF :: ArrowF f ~> => f c -> a ~> cSource

Skip the input and produce a constant output specified as a container.

none :: (Alternative f, ArrowF f ~>) => a ~> bSource

Ignore the input and produce no results. Like `zeroArrow`

.

results :: (Foldable f, ArrowF f ~>) => (a ~> b) -> a ~> BoolSource

Returns a `Bool`

indicating whether the input arrow produces a container
with any results.

# Conditional and filter arrows.

isA :: (Alternative f, ArrowF f ~>) => (a -> Bool) -> a ~> aSource

ifA :: (Foldable f, ArrowF f ~>, ArrowChoice ~>) => (a ~> b) -> (a ~> t) -> (a ~> t) -> a ~> tSource

Use the result of a container arrow as a conditional, like an if-then-else
arrow. When the first arrow produces any results the *then* arrow will be
used, when the first arrow produces no results the *else* arrow will be
used.

when :: (Foldable f, ArrowF f ~>, ArrowChoice ~>) => (a ~> a) -> (a ~> c) -> a ~> aSource

Apply a container arrow only when a conditional arrow produces any
results. When the conditional produces no results the output arrow /behaves
like the identity*. The *second/ input arrow is used as the conditional,
this allow you to write: ` a `when` condition `

guards :: (Alternative f, Foldable f, ArrowF f ~>, ArrowChoice ~>) => (a ~> c) -> (a ~> b) -> a ~> bSource

Apply a container arrow only when a conditional arrow produces any
results. When the conditional produces no results the output arrow
*produces no results*. The *first* input arrow is used as the conditional,
this allow you to write: ` condition `guards` a `

filterA :: (Alternative f, Foldable f, ArrowF f ~>, ArrowChoice ~>) => (a ~> c) -> a ~> aSource

Filter the results of an arrow with a predicate arrow, when the filter condition produces results the input is accepted otherwise it is excluded.

notA :: (Alternative f, Foldable f, ArrowF f ~>, ArrowChoice ~>) => (a ~> c) -> a ~> aSource

Negation container arrow. Only accept the input when the condition produces no output.

orElse :: (Foldable f, ArrowF f ~>, ArrowChoice ~>) => (a ~> b) -> (a ~> b) -> a ~> bSource

Apply the input arrow, when the arrow does not produces any results the
second fallback arrow is applied.
Likely written infix like this ` a `orElse` b `

# Optionality.

maybeA :: (Alternative f, ArrowF f ~>) => Maybe a ~> aSource