mcmc-synthesis 0.1.0.5 → 0.1.1.0
raw patch · 2 files changed
+8/−2 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Language.Synthesis.Distribution: constant :: a -> Distr a
Files
mcmc-synthesis.cabal view
@@ -10,7 +10,7 @@ -- PVP summary: +-+------- breaking API changes -- | | +----- non-breaking API additions -- | | | +--- code changes with no API change-version: 0.1.0.5+version: 0.1.1.0 -- A short (one-line) description of the package. synopsis: MCMC applied to probabilistic program synthesis
src/Language/Synthesis/Distribution.hs view
@@ -1,7 +1,7 @@ {-# LANGUAGE RankNTypes #-} module Language.Synthesis.Distribution ( Distr (Distr), sample, logProbability, negativeInfinity, sumByLogs,- categorical, uniform, randInt, replicate, mix+ categorical, uniform, randInt, replicate, mix, constant ) where import Prelude hiding (replicate)@@ -21,6 +21,12 @@ -- |Negative infinity, the log of 0 probability. negativeInfinity :: Double negativeInfinity = read "-Infinity"+++-- |A distribution containing a single item.+constant :: a -> Distr a+constant item = Distr { sample = return item+ , logProbability = const 0 } -- |Computes (log . sum . map exp), with more numeric precision. sumByLogs :: [Double] -> Double