Add newtype wrappers to fix scale/rate confusion
未关闭
design-shed
- 主要语言
- Haskell
- 星标
- 309
- 派生
- 76
- PR 合并指标
- 30 天内没有已合并 PR
描述
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:
``` .haskell
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.
贡献指南
这个仓库没有索引到贡献指南
评估
这个 Issue 还没有评估数据。