Name the ontology: `eq`; `cmp`; `to_str`; `from_str`
Off the top of my head here are the things often derived in serde (Rust), dataclasses (Python), Kotlin Multiplatform (kotlinx.serialization), Haskell: Comparison or simple equality (Data.Eq & Data.Ord in Haskell) Serialisation and deserialisation (e.g., Codable in Swift; serde in Rust; kotlinx.serialization.Serializable in Kotlin Multiplatform) Default (e.g., Default in Rust; Default in Haskell) Display (e.g., Display in Rust; Display in Haskell) Copy (e.g., Copy in Rust) What is the name of this ontology of names? - And is there an authoritative list of them somewhere? I'm implementing this in C—as a new C to C compiler written in C—and am trying to be exhaustive (currently have to_str, from_str, to_json, from_json, eq; and about to add deep_copy)…
Off the top of my head here are the things often derived in serde (Rust), dataclass
es (Python), Kotlin Multiplatform (kotlinx.serialization
), Haskell:
- Comparison or simple equality (
Data.Eq
&Data.Ord
in Haskell) - Serialisation and deserialisation (e.g.,
Codable
in Swift; serde in Rust;kotlinx.serialization.Serializable
in Kotlin Multiplatform) - Default (e.g.,
Default
in Rust;Default
in Haskell) - Display (e.g.,
Display
in Rust;Display
in Haskell) - Copy (e.g.,
Copy
in Rust)
What is the name of this ontology of names? - And is there an authoritative list of them somewhere?
I'm implementing this in C—as a new C to C compiler written in C—and am trying to be exhaustive (currently have to_str
, from_str
, to_json
, from_json
, eq
; and about to add deep_copy
)…