-
Notifications
You must be signed in to change notification settings - Fork 23
Description
Is your feature request related to a problem? Please describe.
Many types exposed from the Control.Monad.IOSim module have fields of type Time. For example, the field seTime of SimEvent. However, the type Time is not exported from Control.Monad.IOSim and is only available from the deprecated si-timers package. The deprecated si-timers package recommends using the nearly equivalent modules from the io-classses package, but, unfortunately, the io-classes package does not export the Time type. Therefore, in order to use the seTime field of a SimEvent, one has to depend on the deprecated si-timers package for—and only for—that newtype.
Describe the solution you'd like
Export the Time newtype with its constructor from the Control.Monad.IOSim module. This isn't formally a breaking change, but can be a breaking change if users are importing both Control.Monad.IOSim from io-sim and Control.Monad.Class.MonadTime.SI from si-timers unqualified. However, it should not be a breaking change in any codebase with import linting.
Describe alternatives you've considered
There are two alternative solutions:
- Unpack the
seTimefield and others to expose the underlyingDiffTimevalue instead. This is the right solution, but is certainly a breaking change, which feels too major a change for such a minor improvement. - Define a pattern synonym for the
SimEventconstructor that unpacksseTimeasseDiffTime. This isn't formally a breaking change, but can be a breaking change if the pattern synonym name clashes with any common names, which should be easy enough to avoid. However, this feels a bit heavy handed for such a small change, as it would require numerous pattern synonyms.
Are you willing to implement it?
- Yes.