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
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 seTime field and others to expose the underlying DiffTime value 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 SimEvent constructor that unpacks seTime as seDiffTime. 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.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Many types exposed from the
Control.Monad.IOSim
module have fields of typeTime
. For example, the fieldseTime
ofSimEvent
. However, the typeTime
is not exported fromControl.Monad.IOSim
and is only available from the deprecatedsi-timers
package. The deprecatedsi-timers
package recommends using the nearly equivalent modules from theio-classses
package, but, unfortunately, theio-classes
package does not export theTime
type. Therefore, in order to use theseTime
field of aSimEvent
, one has to depend on the deprecatedsi-timers
package for—and only for—that newtype.Describe the solution you'd like
Export the
Time
newtype with its constructor from theControl.Monad.IOSim
module. This isn't formally a breaking change, but can be a breaking change if users are importing bothControl.Monad.IOSim
fromio-sim
andControl.Monad.Class.MonadTime.SI
fromsi-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:
seTime
field and others to expose the underlyingDiffTime
value instead. This is the right solution, but is certainly a breaking change, which feels too major a change for such a minor improvement.SimEvent
constructor that unpacksseTime
asseDiffTime
. 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?
The text was updated successfully, but these errors were encountered: