definitive-base-2.6.3: A small Prelude wrapper to simplify my own Haskell developments

Safe HaskellNone
LanguageHaskell2010

Data.Probability

Documentation

newtype ProbT t m a Source #

Constructors

ProbT (WriterT (Product t) (LogicT m) a) 

Instances

Ring t => MonadWriter (Product t) (ProbT t m) Source # 

Methods

tell :: Product t -> ProbT t m () Source #

listen :: ProbT t m a -> ProbT t m (Product t, a) Source #

censor :: ProbT t m (a, Product t -> Product t) -> ProbT t m a Source #

Ring t => Unit (ProbT t m) Source # 

Methods

pure :: a -> ProbT t m a Source #

(Monad m, Invertible t) => MonadList (ProbT t m) Source # 

Methods

choose :: [a] -> ProbT t m a Source #

(Ring t, MonadFix m) => MonadFix (ProbT t m) Source # 

Methods

mfix :: (a -> ProbT t m a) -> ProbT t m a Source #

Ring t => Monad (ProbT t m) Source # 

Methods

join :: ProbT t m (ProbT t m a) -> ProbT t m a Source #

(>>=) :: ProbT t m a -> (a -> ProbT t m b) -> ProbT t m b Source #

Ring t => Applicative (ProbT t m) Source # 
Ring t => SemiApplicative (ProbT t m) Source # 

Methods

(<*>) :: ProbT t m (a -> b) -> ProbT t m a -> ProbT t m b Source #

Functor (ProbT t m) Source # 

Methods

map :: (a -> b) -> ProbT t m a -> ProbT t m b Source #

Monoid (ProbT t m a) Source # 

Methods

zero :: ProbT t m a Source #

Semigroup (ProbT t m a) Source # 

Methods

(+) :: ProbT t m a -> ProbT t m a -> ProbT t m a Source #

type Prob t a = ProbT t Id a Source #

i'ProbT :: Iso (ProbT t m a) (ProbT t' m' a') (WriterT (Product t) (LogicT m) a) (WriterT (Product t') (LogicT m') a') Source #

probT :: (Monad m, Monad m') => Iso (ProbT t m a) (ProbT t' m' a') (m [(t, a)]) (m' [(t', a')]) Source #

prob :: Iso (Prob t a) (Prob t' a') [(t, a)] [(t', a')] Source #

sample :: Monoid t => (a -> Bool) -> Prob t a -> (t, t) Source #

sampleAll :: (Ord b, Monoid t) => (a -> b) -> Prob t a -> Map b t Source #

normalize :: (Monad m, Invertible t) => ProbT t m a -> ProbT t m a Source #