[Haskell-cafe] Domain modeling

Jean Lopes hawu.bnu at gmail.com
Wed Jan 29 14:12:55 UTC 2020


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?

- Prefix all record fields to avoid name clashes?
- Use *DuplicateRecordFields*?
- Typeclasses???
- other options I am not aware of?

which would you prefer? and why of course :)

Jean Lopes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20200129/ca247ba4/attachment.html>

More information about the Haskell-Cafe mailing list