packages feed

mwc-random-monad 0.3 → 0.4

raw patch · 2 files changed

+45/−8 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ System.Random.MWC.CondensedTable.Monad: data CondensedTable (v :: * -> *) a :: (* -> *) -> * -> *
+ System.Random.MWC.CondensedTable.Monad: genFromTable :: (PrimMonad m, Vector v a) => CondensedTable v a -> Rand m a
+ System.Random.MWC.CondensedTable.Monad: tableBinomial :: Int -> Double -> CondensedTableU Int
+ System.Random.MWC.CondensedTable.Monad: tableFromIntWeights :: (Vector v (a, Word32), Vector v a, Vector v Word32) => v (a, Word32) -> CondensedTable v a
+ System.Random.MWC.CondensedTable.Monad: tableFromProbabilities :: (Vector v (a, Word32), Vector v (a, Double), Vector v a, Vector v Word32, Show a) => v (a, Double) -> CondensedTable v a
+ System.Random.MWC.CondensedTable.Monad: tableFromWeights :: (Vector v (a, Word32), Vector v (a, Double), Vector v a, Vector v Word32, Show a) => v (a, Double) -> CondensedTable v a
+ System.Random.MWC.CondensedTable.Monad: tablePoisson :: Double -> CondensedTableU Int
+ System.Random.MWC.CondensedTable.Monad: type CondensedTableU = CondensedTable Vector
+ System.Random.MWC.CondensedTable.Monad: type CondensedTableV = CondensedTable Vector

Files

+ System/Random/MWC/CondensedTable/Monad.hs view
@@ -0,0 +1,34 @@+-- |+-- Module    : System.Random.MWC.CondesedTable+-- Copyright : (c) 2012 Aleksey Khudyakov+-- License   : BSD3+--+-- Maintainer  : alexey.skladnoy@gmail.com+-- Stability   : experimental+-- Portability : portable+--+-- Monadic wrapper for 'System.Random.MWC.CondesedTable'.+module System.Random.MWC.CondensedTable.Monad (+    -- * Condensed tables+    MWC.CondensedTable+  , MWC.CondensedTableV+  , MWC.CondensedTableU+  , genFromTable+    -- * Constructors for tables+  , MWC.tableFromProbabilities+  , MWC.tableFromWeights+  , MWC.tableFromIntWeights+    -- ** Disrete distributions+  , MWC.tablePoisson+  , MWC.tableBinomial+  ) where++import Control.Monad.Primitive         (PrimMonad)+import qualified Data.Vector.Generic as G+import System.Random.MWC.Monad+import qualified System.Random.MWC.CondensedTable as MWC+++genFromTable :: (PrimMonad m, G.Vector v a) => MWC.CondensedTable v a -> Rand m a+genFromTable tbl = toRand $ \g -> MWC.genFromTable tbl g+{-# INLINE genFromTable #-}
mwc-random-monad.cabal view
@@ -1,5 +1,5 @@ Name:                mwc-random-monad-Version:             0.3+Version:             0.4 License:             BSD3 License-file:        LICENSE Author:              Alexey Khudyakov <alexey.skladnoy@gmail.com>@@ -10,15 +10,18 @@ Cabal-version:       >=1.6 Synopsis:            Monadic interface for mwc-random Description:         -  Simple monadit interface for mwc-random.+  Simple monadic interface for mwc-random.  Library-  build-depends:     base >= 3 && < 5,-                     primitive,-                     vector >= 0.7,-                     mwc-random >= 0.11-  Exposed-modules:   System.Random.MWC.Monad-                     System.Random.MWC.Distributions.Monad+  build-depends:+    base >= 3 && < 5,+    primitive,+    vector >= 0.7,+    mwc-random >= 0.11+  Exposed-modules:+    System.Random.MWC.Monad+    System.Random.MWC.Distributions.Monad+    System.Random.MWC.CondensedTable.Monad   Ghc-options:       -O2 -Wall   Ghc-prof-options:  -auto-all