Typeclasses.
Derivations
Typeclasses describe interfaces (e.g., Show, Eq, Ord). Many standard instances can be generated automatically via deriving — or implemented manually.
Automatic deriving:
Define a custom instance:
Derivations
Typeclasses describe interfaces (e.g., Show, Eq, Ord). Many standard instances can be generated automatically via deriving — or implemented manually.
Automatic deriving:
Define a custom instance: