advancedtelematic / quickcheck-state-machine

Test monadic programs using state machine based models
Other
203 stars 25 forks source link

Simplify/unify generic code (CommandNames, GBounded, Rank2) #260

Open stevana opened 5 years ago

stevana commented 5 years ago

In PR #259 it was noted that GConName/CommandNames could be simplified using generic-sop. In PR #242 another dependency on generic-data is introduced in order to get generic bounded and enum instances. Perhaps generic-sop or generic-data can be used for both, and also the Rank2 stuff.

We should consider how much the refactor would simplify the library (if at all considering the overhead of, for example, learning generic-sop) vs how annoying it would be for the users of the library (yet another dependency, api change, extension and deriving instance, etc)...

Lysxia commented 5 years ago

I also put gconName in generic-data. The plural version gconNames can be obtained as map conIdToString (conIdEnum @MyType); I wouldn't mind adding it as a shorthand too.

I'm not sure what to do about Rank2.