As far as I can tell, the Eval type is, for recent GHC versions, a complete re-implementation of the basic IO interface, but by another name. It therefore strikes me that this would be a good place to use a newtype wrapper instead. Then only the really parallel-specific functions would need to dig into the detailed representation. Sequencing evaluation relative to I/O, as another ticket suggests, would also be easy:
evaluatePar = coerce evaluate
Revealing the wrapping through an internals module would allow others to use the detailed representation as well, without needing unsafeCoerce but also without guaranteed API stability.
As far as I can tell, the
Evaltype is, for recent GHC versions, a complete re-implementation of the basicIOinterface, but by another name. It therefore strikes me that this would be a good place to use anewtypewrapper instead. Then only the really parallel-specific functions would need to dig into the detailed representation. Sequencing evaluation relative to I/O, as another ticket suggests, would also be easy:evaluatePar = coerce evaluateRevealing the wrapping through an internals module would allow others to use the detailed representation as well, without needing
unsafeCoercebut also without guaranteed API stability.