The time package does not provide the MkDiffTime constructor, DiffTime .
To create an instance of Data , you usually work with type constructors. Even if you automatically extract it, then what the derived instance will do.
Fortunately, it can work to some degree. You can extract data from DiffTime using toRational , and you can wrap a number in DiffTime using fromRational . Therefore, it should be possible to "fake" a Data instance using a "fake" constructor. This will be done "manually" (not displayed).
As for why the DiffTime constructor DiffTime not displayed, it will be similar to the reasoning behind private in C ++ et al. This gives DiffTime creators the freedom to change their implementation without breaking anything. Indeed, if they change the structure, it will not break your "fake" instance of Data and will not violate your serialization format.
source share