Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data WeightedT s m a
- runWeightedT :: Semiring s => WeightedT s m a -> m (a, s)
- pattern WeightedT :: forall m s a. (Functor m, Semiring s) => m (a, s) -> WeightedT s m a
- type Weighted s = WeightedT s Identity
- runWeighted :: Semiring s => Weighted s a -> (a, s)
- pattern Weighted :: forall s a. Semiring s => (a, s) -> Weighted s a
- execWeightedT :: (Monad m, Semiring s) => WeightedT s m a -> m s
- evalWeightedT :: (Monad m, Semiring s) => WeightedT s m a -> m a
- execWeighted :: Semiring s => Weighted s a -> s
- evalWeighted :: Semiring s => Weighted s a -> a
Documentation
A monad transformer similar to WriterT
, except that it does not leak
space, and it uses the Semiring
class, rather than Monoid
.
MonadTrans (WeightedT s) Source # | |
(Semiring s, Monad m) => MonadWriter (Mul s) (WeightedT s m) Source # | |
Monad m => Monad (WeightedT s m) Source # | |
Functor m => Functor (WeightedT s m) Source # | |
Monad m => Applicative (WeightedT s m) Source # | |
(Alternative m, Monad m, Semiring s) => Alternative (WeightedT s m) Source # | |
runWeightedT :: Semiring s => WeightedT s m a -> m (a, s) Source #
runWeighted :: Semiring s => Weighted s a -> (a, s) Source #
execWeighted :: Semiring s => Weighted s a -> s Source #
evalWeighted :: Semiring s => Weighted s a -> a Source #