Skip to content

Commit

Permalink
Add note to function geometric
Browse files Browse the repository at this point in the history
  • Loading branch information
bredelings committed Jan 4, 2025
1 parent 93ba413 commit 6416e14
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions haskell/Probability/Distribution/Geometric.hs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ geometric_effect x = do
add_move $ sliceSampleInteger x geometric_bounds
add_move $ incDecMH x geometric_bounds

geometric :: Double -> Geometric
geometric p_success = Geometric (toFloating p_success)
{- NOTE: Why specify that pSuccess :: Double ?
This avoids callers of (geometric p) getting
saddled with ambiguous types.
See note in Data.Floating.Types
-}

geometric :: Double -> Geometric
geometric pSuccess = Geometric (toFloating pSuccess)

0 comments on commit 6416e14

Please sign in to comment.