Skip to content

Conversation

@daikonradish
Copy link
Contributor

Hi, do we need tests for this?

Copy link
Collaborator

@Shimuuar Shimuuar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There're few comments but otherwise it's good

No. Tests are not needed. It's just a wrapper and generator is tested in mwc-random

import qualified Statistics.Distribution as D
import qualified Statistics.Distribution.Poisson.Internal as I
import Statistics.Internal
import Control.Monad (liftM)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this import needed?

Comment on lines +105 to +107
instance D.ContGen PoissonDistribution where
genContVar (PD lambda) gen = fromIntegral <$> MWC.poisson lambda gen

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please drop ContGen instance. It is discrete distribution after all

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @Shimuuar , i am not able to drop ContGen:

class (DiscreteDistr d, ContGen d) => DiscreteGen d where
  genDiscreteVar :: (StatefulGen g m) => d -> g -> m Int

class (DiscreteDistr d, ContGen d) => DiscreteGen d where

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed! Sorry I forgot about it

@daikonradish
Copy link
Contributor Author

@Shimuuar , i have removed the unnecessary import.

@Shimuuar Shimuuar merged commit 9045465 into haskell:master Jan 9, 2026
15 checks passed
@Shimuuar
Copy link
Collaborator

Shimuuar commented Jan 9, 2026

Thank you. 0.16.5.0 is on hackage

P.S. Generally it's better to make PR from branches other than master. No need to reset master branch afterwards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants