Skip to content

More storable instances?

Is it intentional that we don't have Storable instances for ADTs like Maybe and Either, nor for things like (,)? This approach seems to work:

https://gist.github.com/wyager/8443c3f5a9fc9b52dc28346bafdf409f

Basically what the C compiler would do for a union type with a tag.

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