data61 / GS1Combinators

A library to parse the GS1 Events into Haskell data types
Apache License 2.0
5 stars 1 forks source link

DWhat as a sum type #76

Closed sarafalamaki closed 5 years ago

sarafalamaki commented 5 years ago

Parameterise the what dimension in the event.

Each of the constructors of the sum type DWhat defined in the module Data.GS1.DWhat should contain their own data types.

For example, ObjectDWhat should be a data type, and the relevant part of the definition of DWhat should look like

data DWhat = Obj ObjectDWhat | ..

This is so that we don't call accessor functions on the wrong DWhat. Also, it adds another level of type safety.

Original Author: fal05c

(Moved with github-migration-0.1.0.0 (package github-migration-0.1.0.0 revision df9f38b))