CategoricalData / hydra

Transformations transformed
Apache License 2.0
64 stars 9 forks source link

Rename hydra/core.UnitType to hydra/core.Unit #123

Open joshsh opened 4 months ago

joshsh commented 4 months ago

The UnitType type in Hydra Core is, unlike its siblings IntegerType, MapType, etc. not used exclusively in type definitions. The one and only instance of this type is the unit value, which is used throughout Hydra at both the term and the type level. Rename the type to Unit.

wisnesky commented 4 months ago

unit is also the empty tuple and empty record

joshsh commented 4 months ago

Empty tuple is different in Hydra (though yes it can be considered equivalent), and there are also other empty records in Hydra which are distinct from unit. It’s the canonical empty record, though.