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.

  1. JSValueForSend :: JSValueRef -> JSValueForSend

    jsaddle Language.Javascript.JSaddle.Types

    No documentation available.

  2. class Uniform a

    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.

  3. class UniformRange a

    mwc-probability System.Random.MWC.Probability

    The class of types for which a uniformly distributed value can be drawn from a range.

  4. discreteUniform :: forall (m :: Type -> Type) f a . (PrimMonad m, Foldable f) => f a -> Prob m a

    mwc-probability System.Random.MWC.Probability

    The discrete uniform distribution.

    >>> sample (discreteUniform [0..10]) gen
    6
    
    >>> sample (discreteUniform "abcdefghijklmnopqrstuvwxyz") gen
    'a'
    

  5. uniform :: forall (m :: Type -> Type) a . (PrimMonad m, Variate a) => Prob m a

    mwc-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
    

  6. uniformM :: (Uniform a, StatefulGen g m) => g -> m a

    mwc-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]
    

  7. uniformR :: forall (m :: Type -> Type) a . (PrimMonad m, Variate a) => (a, a) -> Prob m a

    mwc-probability System.Random.MWC.Probability

    The uniform distribution over the provided interval.

    >>> sample (uniformR (0, 1)) gen
    0.44984153252922365
    

  8. uniformRM :: (UniformRange a, StatefulGen g m) => (a, a) -> g -> m a

    mwc-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>
    The following law should hold to make the function always defined:
    uniformRM (a, b) = uniformRM (b, a)
    

  9. 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.

  10. acceptFork :: MonadIO m => Socket -> ((Socket, SockAddr) -> IO ()) -> m ThreadId

    network-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.

Page 647 of many | Previous | Next