Portability | ghc |
---|---|

Stability | beta |

Maintainer | Neil Sculthorpe <neil@ittc.ku.edu> |

Safe Haskell | Safe-Infered |

- guardFail :: Monad m => Bool -> String -> m ()
- condM :: Monad m => m Bool -> m a -> m a -> m a
- whenM :: Monad m => m Bool -> m a -> m a
- tryM :: MonadPlus m => a -> m a -> m a
- mtryM :: (MonadPlus m, Monoid a) => m a -> m a
- attemptM :: MonadPlus m => m a -> m (Maybe a)
- testM :: MonadPlus m => m a -> m Bool
- notM :: MonadPlus m => m a -> m ()
- result :: Arrow ~> => (b -> c) -> (a ~> b) -> a ~> c
- argument :: Arrow ~> => (a -> b) -> (b ~> c) -> a ~> c
- idR :: Category ~> => a ~> a
- (<+) :: ArrowPlus ~> => (a ~> b) -> (a ~> b) -> a ~> b
- readerR :: ArrowApply ~> => (a -> a ~> b) -> a ~> b
- acceptR :: (ArrowZero ~>, ArrowApply ~>) => (a -> Bool) -> a ~> a
- tryR :: ArrowPlus ~> => (a ~> a) -> a ~> a
- attemptR :: ArrowPlus ~> => (a ~> a) -> a ~> (Bool, a)
- changedR :: (ArrowPlus ~>, ArrowApply ~>, Eq a) => (a ~> a) -> a ~> a
- repeatR :: ArrowPlus ~> => (a ~> a) -> a ~> a
- (>+>) :: (ArrowPlus ~>, ArrowApply ~>) => (a ~> a) -> (a ~> a) -> a ~> a
- orR :: (ArrowZero ~>, ArrowPlus ~>, ArrowApply ~>) => [a ~> a] -> a ~> a
- andR :: Arrow ~> => [a ~> a] -> a ~> a

# Monad Combinators

tryM :: MonadPlus m => a -> m a -> m aSource

Catch a failing monadic computation, making it succeed with a constant value.

mtryM :: (MonadPlus m, Monoid a) => m a -> m aSource

Catch a failing monadic computation, making it succeed with `mempty`

.

attemptM :: MonadPlus m => m a -> m (Maybe a)Source

Catch a failing monadic computation, making it succeed with `Nothing`

.

# Arrow Combinators

result :: Arrow ~> => (b -> c) -> (a ~> b) -> a ~> cSource

Apply a pure function to the result of an `Arrow`

.

argument :: Arrow ~> => (a -> b) -> (b ~> c) -> a ~> cSource

Apply a pure function to the argument to an `Arrow`

.

readerR :: ArrowApply ~> => (a -> a ~> b) -> a ~> bSource

acceptR :: (ArrowZero ~>, ArrowApply ~>) => (a -> Bool) -> a ~> aSource

Look at the argument to an `Arrow`

, and choose to be either the identity arrow or the zero arrow.

tryR :: ArrowPlus ~> => (a ~> a) -> a ~> aSource

Catch a failing `ArrowPlus`

, making it into an identity.

attemptR :: ArrowPlus ~> => (a ~> a) -> a ~> (Bool, a)Source

Catch a failing `ArrowPlus`

, making it succeed with a Boolean flag.
Useful when defining `anyR`

instances.

changedR :: (ArrowPlus ~>, ArrowApply ~>, Eq a) => (a ~> a) -> a ~> aSource

Makes an `Arrow`

fail if the result value equals the argument value.

repeatR :: ArrowPlus ~> => (a ~> a) -> a ~> aSource

Repeat an `ArrowPlus`

until it fails, then return the result before the failure.
Requires at least the first attempt to succeed.

(>+>) :: (ArrowPlus ~>, ArrowApply ~>) => (a ~> a) -> (a ~> a) -> a ~> aSource

Attempts two `Arrows`

s in sequence, succeeding if one or both succeed.