| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Boltzmann.Data.Types
Contents
Description
Internal module
- data SomeData m where
- type SomeData' = SomeData Proxy
- data Alias m where
- type AliasR m = Alias (RejectT m)
- alias :: (Monad m, Data a, Data b) => (a -> m b) -> Alias m
- aliasR :: (Monad m, Data a, Data b) => (a -> m b) -> AliasR m
- coerceAlias :: Coercible m n => Alias m -> Alias n
- coerceAliases :: Coercible m n => [Alias m] -> [Alias n]
- composeCastM :: forall a b c d m. (Typeable b, Typeable c) => (m c -> d) -> (a -> m b) -> a -> d
- castM :: forall a b m. (Typeable a, Typeable b) => m a -> m b
- unSomeData :: Typeable a => SomeData m -> m a
- applyCast :: (Typeable a, Data b) => (m a -> m b) -> SomeData m -> SomeData m
- castError :: (Typeable a, Typeable b) => proxy a -> proxy' b -> c
- withProxy :: (a -> b) -> proxy a -> b
- reproxy :: proxy a -> Proxy a
- proxyType :: m a -> proxy a -> m a
- someData' :: Data a => proxy a -> SomeData'
- type Size = Int
- newtype RejectT m a = RejectT {}
- runRejectT :: Monad m => (Size, Size) -> RejectT m a -> m a
- newtype AMonadRandom m a = AMonadRandom {
- asMonadRandom :: m a
- class Monad m => MonadRandomLike m where
Documentation
coerceAlias :: Coercible m n => Alias m -> Alias n #
coerceAlias :: Alias m -> Alias (AMonadRandom m)
coerceAliases :: Coercible m n => [Alias m] -> [Alias n] #
coerceAliases :: [Alias m] -> [Alias (AMonadRandom m)]
composeCastM :: forall a b c d m. (Typeable b, Typeable c) => (m c -> d) -> (a -> m b) -> a -> d #
composeCast f g = f . g
unSomeData :: Typeable a => SomeData m -> m a #
Internal transformer for rejection sampling.
ReaderT Size (StateT Size (MaybeT m)) a
Instances
| MonadTrans RejectT # | |
| Monad (RejectT m) # | |
| Functor (RejectT m) # | |
| Applicative (RejectT m) # | |
| MonadRandomLike m => MonadRandomLike (RejectT m) # | |
newtype AMonadRandom m a #
Constructors
| AMonadRandom | |
Fields
| |
Instances
| MonadTrans AMonadRandom # | |
| Monad m => Monad (AMonadRandom m) # | |
| Functor m => Functor (AMonadRandom m) # | |
| Applicative m => Applicative (AMonadRandom m) # | |
| MonadRandom m => MonadRandomLike (AMonadRandom m) # | |
Dictionaries
class Monad m => MonadRandomLike m where #
defines basic components to build generators,
allowing the implementation to remain abstract over both the
MonadRandomLike mGen type and MonadRandom instances.
For the latter, the wrapper AMonadRandom is provided to avoid
overlapping instances.
Methods
Called for every constructor. Counter for ceiled rejection sampling.
doubleR :: Double -> m Double #
doubleR upperBound: generates values in [0, upperBound].
integerR :: Integer -> m Integer #
integerR upperBound: generates values in [0, upperBound-1].
Default Int generator.
Default Double generator.
Default Char generator.
Instances
| MonadRandomLike Gen # | |
| MonadRandom m => MonadRandomLike (AMonadRandom m) # | |
| MonadRandomLike m => MonadRandomLike (RejectT m) # | |