The current implementation for the combined function and enum types is getting out of hand. For each mapping (Location, Definition, etc.) using SpecValues or ValueNames two functions need to be added to SpecValue. While the current design is simple and usable it does not scale well if more mappings are added. Thus something better is needed.
A better design would probably be to add something like
data BiMap f = BiMap (f EnumValue) (f FuncValue)
and using this to recreate the current mappings (using newtypes). Furthermore the addition of data Bi b = Bi b b (or something like that) could improve some double values (like the reuses filepaths), and possibly reduce the number of explicit type signatures.
The current implementation for the combined function and enum types is getting out of hand. For each mapping (Location, Definition, etc.) using
SpecValues orValueNames two functions need to be added toSpecValue. While the current design is simple and usable it does not scale well if more mappings are added. Thus something better is needed.A better design would probably be to add something like
and using this to recreate the current mappings (using newtypes). Furthermore the addition of
data Bi b = Bi b b(or something like that) could improve some double values (like the reuses filepaths), and possibly reduce the number of explicit type signatures.