HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulevinyl-0.14.3Haskell2010

Data.Vinyl.Recursive

Recursive definitions of various core vinyl functions. These are simple definitions that put less strain on the compiler. They are expected to have slower run times, but faster compile times than the definitions in Data.Vinyl.Core.

  • 14 values
  • Packagevinyl-0.14.3
  • Exports14
  • LanguageHaskell2010
  • LicenceMIT
  • SourceRecursive.hs
valuerappend :: Rec f as -> Rec f bs -> Rec f (as ++ bs)
#

Two records may be pasted together.

valuermap :: (forall (x :: u). f x -> g x) -> Rec f rs -> Rec g rs
#

Rec _ rs with labels in kind u gives rise to a functor Hask^u -> Hask; that is, a natural transformation between two interpretation functors f,g may be used to transport a value from Rec f rs to Rec g rs.

value(<<$>>) :: (forall (x :: u). f x -> g x) -> Rec f rs -> Rec g rs
#

A shorthand for rmap.

value(<<&>>) :: Rec f rs -> (forall (x :: u). f x -> g x) -> Rec g rs
#

An inverted shorthand for rmap.

valuerapply :: Rec (Lift (->) f g) rs -> Rec f rs -> Rec g rs
#

A record of components f r -> g r may be applied to a record of f to get a record of g.

valuertraverse
  1. :: Applicative h
  2. => forall (x :: u). f x -> h (g x)
  3. -> Rec f rs
  4. -> h (Rec g rs)
#

A record may be traversed with respect to its interpretation functor. This can be used to yank (some or all) effects from the fields of the record to the outside of the record.

valuerzipWith
  1. :: forall (x :: k). f x -> g x -> h x
  2. -> forall (xs :: [k]). Rec f xs -> Rec g xs -> Rec h xs
#

Given a natural transformation from the product of f and g to h, we have a natural transformation from the product of Rec f and Rec g to Rec h. You can also think about this operation as zipping two records with the same element types but different interpretations.

valuerfoldMap :: Monoid m => (forall (x :: u). f x -> m) -> Rec f rs -> m
#

Map each element of a record to a monoid and combine the results.

valuerecordToList :: Rec (Const a) rs -> [a]
#

A record with uniform fields may be turned into a list.

valuereifyConstraint
  1. :: RecAll f rs c
  2. => proxy c
  3. -> Rec f rs
  4. -> Rec (Dict c :. f) rs
#

Sometimes we may know something for all fields of a record, but when you expect to be able to each of the fields, you are then out of luck. Surely given ∀x:u.φ(x) we should be able to recover x:u ⊢ φ(x)! Sadly, the constraint solver is not quite smart enough to realize this and we must make it patently obvious by reifying the constraint pointwise with proof.