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

Stock.Type

Description

Newtype wrappers that drive the Stock plugin. Writing deriving C via Stock T (or via Stock1 F for a class over a type constructor) asks the plugin to synthesize the instance from T's structure — no Generic, no hand-written instances.

Synopsis

Documentation

newtype Stock a Source #

Wrap a type a so that deriving C via Stock a synthesizes C a.

Constructors

Stock 

Fields

newtype Stock1 (f :: k -> Type) (a :: k) Source #

Wrap a type constructor f so that deriving C via Stock1 f synthesizes a C f instance (for classes over type constructors, e.g. Functor). Poly-kinded in the index (f :: k -> Type) so it works for classes over non-Type indices too (e.g. TestEquality) — maximally polymorphic.

Constructors

Stock1 

Fields

newtype Stock2 (bi :: k -> j -> Type) (a :: k) (b :: j) Source #

Wrap a two-parameter type constructor p so that deriving C via Stock2 p synthesizes a C p instance (for classes over two-parameter type constructors, e.g. Bifunctor, Bifoldable, Eq2, Ord2, Show2, Read2, Category).

Constructors

Stock2 

Fields