stock-0.1.0.0: Stock-style deriving via coercion, with no Generic
Safe HaskellNone
LanguageGHC2021

Stock.Classes1

Description

The lifted Data.Functor.Classes hierarchy over Stock1 F: Eq1, Ord1, Show1, Read1. Each is the structural synthesizer of its unlifted twin (Eq/Ord) with one change: a field that is the functor parameter a is handled by the supplied function argument (liftEq's eq, liftCompare's cmp) instead of the field's own instance, and a field of shape H a recurses through H's own lifted method.

Since base-4.18 these classes carry a quantified superclass — Eq1 f requires forall a. Eq a => Eq (f a) and Ord1 f likewise for Ord — so we synthesize those superclass dictionaries too (from the same lifted method, instantiated at eq = (==) / cmp = compare).

Documentation