HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulevinyl-0.14.3Haskell2010

Data.Vinyl

  • 4 types
  • 5 classes
  • 13 values
  • Packagevinyl-0.14.3
  • Exports27
  • LanguageHaskell2010
  • LicenceMIT
  • SourceMethod.hs
classclass RecMapMethod (c :: Type -> Constraint) (f :: u -> Type) (ts :: [u]) where
#

Apply a typeclass method to each field of a Rec where the class constrains the index of the field, but not its interpretation functor.

Methods

Instances2RecMapMethod
classclass RecPointed (c :: Type -> Constraint) (f :: u -> Type) (ts :: [u]) where
#

Generate a record from fields derived from type class instances.

Methods

Instances2RecPointed
  • RecPointed c f '[]Defined in vinyl-0.14.3 · Data.Vinyl.Class.Method
  • (c (f t), RecPointed c f ts) => RecPointed c f (t ': ts)Defined in vinyl-0.14.3 · Data.Vinyl.Class.Method
valuermapMethodF
  1. :: (Functor f, FieldPayload f ~ 'FieldId, RecMapMethod c f ts)
  2. => forall a. c a => a -> a
  3. -> Rec f ts
  4. -> Rec f ts
#

Apply a typeclass method to each field of a Rec f ts using the Functor instance for f to lift the function into the functor. This is a commonly-used specialization of rmapMethod composed with fmap.

newtypenewtype ARec (f :: k -> Type) (ts :: [k])
#

An array-backed extensible record with constant-time field access.

Instances9RecSubset, RecElem, Eq, Ord, Show, RecElemFCtx, …
valuexrec :: (IsoXRec f t, TupleXRec f t) => ListToHKDTuple f t -> Rec f t
#

Build a Rec from a tuple passing through XRec. This admits the most concise syntax for building a Rec. For example, xrec ("joe", 23) :: Rec Identity '[String, Int].

newtypenewtype ElField (t :: (Symbol, Type))
#

A value with a phantom Symbol label. It is not a Haskell Functor, but it is used in many of the same places a Functor is used in vinyl.

Morally: newtype ElField (s, t) = Field t But GHC doesn't allow that

Constructors

Instances19Eq, Floating, Fractional, Num, Ord, Real, …
newtypenewtype SRec (f :: k -> Type) (ts :: [k])
#

A simpler type for SRec2 whose RecElem and RecSubset instances are specialized to the ElField functor.

Instances4RecElem, RecSubset, RecElemFCtx, RecSubsetFCtx
classclass IsoXRec (f :: u -> Type) (ts :: [u]) where
#

Conversion between XRec and Rec. It is convenient to build and consume XRec values to reduce syntactic noise, but Rec has a richer API that is difficult to build around the HKD type family.

Methods

Instances2IsoXRec
  • IsoXRec f '[]Defined in vinyl-0.14.3 · Data.Vinyl.XRec
  • (IsoXRec f ts, IsoHKD f t) => IsoXRec f (t ': ts)Defined in vinyl-0.14.3 · Data.Vinyl.XRec
valuexrmap
  1. :: XRMap f g rs
  2. => forall (a :: u). HKD f a -> HKD g a
  3. -> XRec f rs
  4. -> XRec g rs
#

This is rmap for XRec. We apply a natural transformation between interpretation functors to transport a record value between interpretations.

classclass XRApply (f :: u -> Type) (g :: u -> Type) (rs :: [u]) where
#

Like rapply: record of components f r -> g r may be applied to a record of f to get a record of g.

Methods

Instances2XRApply
  • XRApply f g '[]Defined in vinyl-0.14.3 · Data.Vinyl.XRec
  • XRApply f g rs => XRApply f g (r ': rs)Defined in vinyl-0.14.3 · Data.Vinyl.XRec
classclass XRMap (f :: u -> Type) (g :: u -> Type) (rs :: [u]) where
#

The implementation of xrmap is broken into a type class to permit unrolling of the recursion across a record. The function mapped across the vector hides the HKD type family under a newtype constructor to help the type checker.

Instances2XRMap
  • XRMap f g '[]Defined in vinyl-0.14.3 · Data.Vinyl.XRec
  • (XRMap f g rs, IsoHKD f r, IsoHKD g r) => XRMap f g (r ': rs)Defined in vinyl-0.14.3 · Data.Vinyl.XRec