
30 Jan
2020
30 Jan
'20
4:56 a.m.
Jean Lopes
Hi!
I'm trying to encode a domain which is full of simple records, and a lot of field name clashes.
Here is a simple example, a.k.a. 1:1 with the domain-spec:
data C001 {
-- other stuff indMov :: Bool } data C170 { -- other stuff indMov :: Bool }
There is ~148 records with this field (indMov), all with the same meaning. What are my options to encode this in Haskell?
Is there some reason why they must be different types? data C = C001 {other_stuff:: Real, indMov:: Bool } | C170 {other_stuff…, indMov:: Bool } is the first thing that comes to mind. -- Jón Fairbairn Jon.Fairbairn@cl.cam.ac.uk