HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Modulevinyl-0.14.3Haskell2010

Data.Vinyl.Syntax

Concise vinyl record field lens syntax. This module exports an orphan instance to make working with labels a bit more powerful. It will conflict with other libraries that provide special syntax for labels (i.e. placing a label in function application position, as in #age 23, or using a label as a lens).

Example: fieldRec (#x =: True, #y =: b) :: FieldRec '[ '("x", Bool), '("y", Char) ] fieldRec (#x =: True, #y =: b) & #x %~ not

  • Packagevinyl-0.14.3
  • Exports0
  • LanguageHaskell2010
  • LicenceMIT
  • SourceSyntax.hs

Orphan instances

1 instance
  • (HasField record s ts ts' t t', Functor f, RecElemFCtx record ElField, a' ~ (t -> f t'), b' ~ (record ElField ts -> f (record ElField ts'))) => IsLabel s (a' -> b')

    Concise record construction syntax. Example: record (#name Joe, #age 23). instance forall s a b. (KnownSymbol s, b ~ ElField '(s,a)) => IsLabel s (a -> b) where #if 1000 < 802 fromLabel _ = Field s a #else fromLabel = Field s a #endif

    Concise ElField lenses. Example myRec & #name %~ map toUpper.

    Credit to Tikhon Jelvis who shared this technique on the Haskell-Cafe mailing list on December 23, 2017.