
23 Aug
2017
23 Aug
'17
9:29 p.m.
I have a sum type with a lot of constructors and I'm not sure how to represent the type with maintainability in mind. For example, data A = A1 | A2 Int | A3 Text Int32 Bool | ... | A100 Bool Every inner type is concrete. There are 100+ constructors with no sign of ever getting reduced. What technique would you recommend to keep the sum type approach but not having to define them all in one spot? I'm thinking 1 inner type + 1 function to construct per file (if that's possible).