From 155a390d1b6c9a5e84aa462a9dd8e1ea27345684 Mon Sep 17 00:00:00 2001 From: Justin Bedo Date: Sat, 21 Feb 2026 14:35:10 +1100 Subject: add top level signatures --- src/PPL/Distr.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/PPL/Distr.hs b/src/PPL/Distr.hs index 54db358..cd8f029 100644 --- a/src/PPL/Distr.hs +++ b/src/PPL/Distr.hs @@ -102,6 +102,7 @@ geom p = first 0 <$> iid (bern p) first n (_ : xs) = first (n + 1) xs first _ _ = undefined +uniform :: Prob Double uniform = do z <- unbounded let r = countTrailingZeros z - 11 @@ -129,6 +130,7 @@ bounded lower upper = do s = b / g - a / g eps = if abs a <= abs b then negate a / g - (s - b / g) else b / g - (s + a / g) +unbounded :: Prob Word64 unbounded = Prob draw bounded' :: Integral a => a -> a -> Prob a -- cgit v1.2.3