IntersectMBO / IntersectMBO/cardano-node
Clean up mkConf / mkConfig / mkConfigAbs naming in cardano-testnet
- Dominant language
- Haskell
- Stars
- 3.2k
- Forks
- 754
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 20
Description
`Testnet.Start.Types` has three functions for creating `Conf` values:
- `mkConf :: (HasCallStack, MonadTest m) => FilePath -> m Conf` - annotates the path in test output, then calls `mkConfig`
- `mkConfig :: FilePath -> Conf` - pure, adds trailing separator and defaults
- `mkConfigAbs :: FilePath -> IO Conf` - makes path absolute, creates directory, calls `mkConfig`
The names do not communicate the differences.
`mkConf` vs `mkConfig` looks like a typo rather than a meaningful distinction.
`mkConfigAbs` conflates "make path absolute" with "run in IO".
Suggested cleanup (open to better ideas):
- `mkConfig` stays as the pure core
- `mkConf` becomes something like `mkConfigForTest` or `mkConfigAnnotated` to signal the `MonadTest` dependency
- `mkConfigAbs` becomes something like `mkConfigAbsolute` or `mkConfigIO`
Or collapse them if the separate variants are not pulling their weight.
**Context:** Flagged by @carbolymer in https://github.com/IntersectMBO/cardano-node/pull/6346 review comments.
Contributor guide
Assessment
This issue has not been assessed yet.