Advise to use newtypes in fields of same type
- Dominant language
- Haskell
- Stars
- 597
- Forks
- 53
- PR merge metrics
- No merged PRs in 30d
Description
Advice to use newtypes in data types with multiple fields with the same type:
```haskell
data Params = Params
{ height :: !Double -- ^ in cmeters
, weight :: !Double -- ^ in kgs
}
```
replace with
```haskell
data Params = Params
{ height :: !Cm
, weight :: !Kg
}
newtype Cm = {unCm :: Double}
newtype Kg = {unKg :: Double}
```
Contributor guide
Research direction
The issue names no files, tests, or entry points. Start by locating the analyzer logic for advice about data declarations and reviewing nearby checks and tests. Done should mean the analyzer can identify multiple fields sharing a type and advise distinct newtypes, with coverage for the Params-style example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100