Hoogle Search
Within LTS Haskell 24.40 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
JSValueForSend :: JSValueRef -> JSValueForSendjsaddle Language.Javascript.JSaddle.Types No documentation available.
-
mwc-probability System.Random.MWC.Probability The class of types for which a uniformly distributed value can be drawn from all possible values of the type.
-
mwc-probability System.Random.MWC.Probability The class of types for which a uniformly distributed value can be drawn from a range.
discreteUniform :: forall (m :: Type -> Type) f a . (PrimMonad m, Foldable f) => f a -> Prob m amwc-probability System.Random.MWC.Probability The discrete uniform distribution.
>>> sample (discreteUniform [0..10]) gen 6 >>> sample (discreteUniform "abcdefghijklmnopqrstuvwxyz") gen 'a'
uniform :: forall (m :: Type -> Type) a . (PrimMonad m, Variate a) => Prob m amwc-probability System.Random.MWC.Probability The uniform distribution at a specified type. Note that Double and Float variates are defined over the unit interval.
>>> sample uniform gen :: IO Double 0.29308497534914946 >>> sample uniform gen :: IO Bool False
uniformM :: (Uniform a, StatefulGen g m) => g -> m amwc-probability System.Random.MWC.Probability Generates a value uniformly distributed over all possible values of that type. There is a default implementation via Generic:
>>> :set -XDeriveGeneric -XDeriveAnyClass >>> import GHC.Generics (Generic) >>> import System.Random.Stateful >>> data MyBool = MyTrue | MyFalse deriving (Show, Generic, Finite, Uniform) >>> data Action = Code MyBool | Eat (Maybe Bool) | Sleep deriving (Show, Generic, Finite, Uniform) >>> gen <- newIOGenM (mkStdGen 42) >>> uniformListM 10 gen :: IO [Action] [Code MyTrue,Code MyTrue,Eat Nothing,Code MyFalse,Eat (Just False),Eat (Just True),Eat Nothing,Eat (Just False),Sleep,Code MyFalse]
uniformR :: forall (m :: Type -> Type) a . (PrimMonad m, Variate a) => (a, a) -> Prob m amwc-probability System.Random.MWC.Probability The uniform distribution over the provided interval.
>>> sample (uniformR (0, 1)) gen 0.44984153252922365
uniformRM :: (UniformRange a, StatefulGen g m) => (a, a) -> g -> m amwc-probability System.Random.MWC.Probability Generates a value uniformly distributed over the provided range, which is interpreted as inclusive in the lower and upper bound.
- uniformRM (1 :: Int, 4 :: Int) generates values uniformly from the set <math>
- uniformRM (1 :: Float, 4 :: Float) generates values uniformly from the set <math>
uniformRM (a, b) = uniformRM (b, a)
uniformVector :: (PrimMonad m, StatefulGen g m, Uniform a, Vector v a) => g -> Int -> m (v a)mwc-probability System.Random.MWC.Probability Generate a vector of pseudo-random variates. This is not necessarily faster than invoking uniform repeatedly in a loop, but it may be more convenient to use in some situations.
acceptFork :: MonadIO m => Socket -> ((Socket, SockAddr) -> IO ()) -> m ThreadIdnetwork-simple Network.Simple.TCP Accept a single incoming connection and use it in a different thread. The connection socket is shut down and closed when done or in case of exceptions.