You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have several functions which could take either scale or rate parameter. For example exponential distribution. I can never remember which should be used. I think we shold use type system to encode which kind of parameter should be used. It's also conveninent to be able to pass either rate or scale parameter. So I propose following design:
newtype Rate = Rate Double
newtype Scale = Scale Double
class RateOrScale a where
toRateParameter :: a → Double
toScaleParameter :: a → Double
Name of type class is hmm... not ideal.
The text was updated successfully, but these errors were encountered:
We have several functions which could take either scale or rate parameter. For example exponential distribution. I can never remember which should be used. I think we shold use type system to encode which kind of parameter should be used. It's also conveninent to be able to pass either rate or scale parameter. So I propose following design:
Name of type class is hmm... not ideal.
The text was updated successfully, but these errors were encountered: