Skip to content

Allow to differentiate between newtypes and datatypes when using Generics

When writing a generic instance, I would like to be able to tell whether the type under consideration has been declared using newtype or data.

For example, in SmallCheck we generate values of certain "depth". It is natural to treat datatype constructors as increasing the depth of the constructed value, and newtype constructors as preserving the depth.

Trac metadata
Trac field Value
Version 7.6.1
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component libraries (other)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Edited by Feuerbach
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information