Add missing NFData instances to parallel
Control.Parallel.Strategies contains many NFData instances for types defined in base, but not all. I propose adding NFData instances for all types in base where it makes sense.
Attached is a patch which adds instances for most missing types. For many of those types it would be nicer to define the instances in the module where the type is defined, but that would require a circular dependency.
Instances in patch:
- Data.Fixed (E6, E12, Fixed)
- Data.IORef (IORef)
- Data.STRef (STRef)
- Data.Unique (Unique)
- Data.Version (Version)
- Foreign.C.Error (Errno)
- Foreign.C.Types (all of them)
- System.Exit (!ExitCode)
- System.IO (IOMode, !SeekMode, !BufferMode)
- System.IO.Error (IOErrorType)
- System.Mem.StableName (!StableName)
For some types I had to resort to tricks like comparing a value with itself to force evaluation since I do not have access to all constructors.
Trac metadata
Trac field | Value |
---|---|
Version | 6.10.4 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | libraries (other) |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |