CategoricalData / hydra

Transformations transformed
Apache License 2.0
64 stars 9 forks source link

Eliminate annotation classes #113

Open joshsh opened 8 months ago

joshsh commented 8 months ago

Previously, most of Hydra's core types were parameterized by an "annotation" type, which allowed different forms of annotation to be used in different contexts. As this greatly complicated the code base for little benefit, the annotation type parameters have been removed (in #103, still in progress). Instead, key/value maps of strings to Terms are used everywhere. Now, also remove the legacy AnnotationClass typeclass and simplify the code accordingly.

joshsh commented 7 months ago

Additionally, get rid of the Kv type. Hydra uses a type called Kv ("key/value", chosen for brevity because it used to appear everywhere in type signatures) for attaching annotations to terms and types. This type was created at a time when annotations were parameterized, and other types could also be used. Now, the type is superfluous. The "Annotated" type should just contain a key/value map. Additionally, consider unifying that key/value map with the 'let' binding map.