Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Won't Fix
-
0.11.0
-
None
Description
Thrift's Haskell implementation presently expresses union types as product types. While this is sufficient for functionality, and may mirror the way Thrift works under the hood, it requires the programmer to write unnecessary runtime checks and matches to find the filled field, and verify there is precisely one.
I propose augmenting the existing Haskell Thrift system with union Haskell types for union Thrift types, and augmenting the interface definitions so the user can define a service in terms of either the legacy product types or the new union types.