Haskell already allows us to attach a small amount of metadata in the form of strictness-annotations and similar, however, it seems useful to distinguish between Haskell metadata and embedded metadata. The Haskell constructor taking a lazy argument doesn't necessarily mean the embedded constructor should, or vice versa.
There are two main ideas, the first one is adding a fake constructor with metadata:
Haskell already allows us to attach a small amount of metadata in the form of strictness-annotations and similar, however, it seems useful to distinguish between Haskell metadata and embedded metadata. The Haskell constructor taking a lazy argument doesn't necessarily mean the embedded constructor should, or vice versa.
There are two main ideas, the first one is adding a fake constructor with metadata:
This essentially means the constructor doesn't exist, since you don't have to worry about it when matching, and you can't construct it either.
The other trick is attaching metadata to individual fields like so:
This doesn't affect
PHs
, nor how users interact with the type, but it allows backends to see that it should be strict.