Safe Haskell | None |
---|---|
Language | Haskell2010 |
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 Source #
coerceAlias :: Alias m -> Alias (AMonadRandom m)
coerceAliases :: Coercible m n => [Alias m] -> [Alias n] Source #
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 Source #
composeCast f g = f . g
unSomeData :: Typeable a => SomeData m -> m a Source #
Internal transformer for rejection sampling.
ReaderT Size (StateT Size (MaybeT m)) a
newtype AMonadRandom m a Source #
AMonadRandom | |
|
MonadTrans AMonadRandom Source # | |
Monad m => Monad (AMonadRandom m) Source # | |
Functor m => Functor (AMonadRandom m) Source # | |
Applicative m => Applicative (AMonadRandom m) Source # | |
MonadRandom m => MonadRandomLike (AMonadRandom m) Source # | |
Dictionaries
class Monad m => MonadRandomLike m where Source #
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.
Called for every constructor. Counter for ceiled rejection sampling.
doubleR :: Double -> m Double Source #
doubleR upperBound
: generates values in [0, upperBound]
.
integerR :: Integer -> m Integer Source #
integerR upperBound
: generates values in [0, upperBound-1]
.
Default Int
generator.
Default Double
generator.
Default Char
generator.
MonadRandomLike Gen Source # | |
MonadRandom m => MonadRandomLike (AMonadRandom m) Source # | |
MonadRandomLike m => MonadRandomLike (RejectT m) Source # | |