vinyl-utils-0.2.0.4: Utilities for vinyl

Copyright(c) Marcin Mrotek, 2014
LicenseBSD3
Maintainermarcin.jan.mrotek@gmail.com
Safe HaskellNone
LanguageHaskell2010
Extensions
  • MonoLocalBinds
  • TypeFamilies
  • GADTs
  • GADTSyntax
  • ConstraintKinds
  • PolyKinds
  • DataKinds
  • KindSignatures
  • TypeOperators
  • ExplicitNamespaces

Data.Vinyl.Utils.Field

Description

Manipulation of constraints that apply to field labels (as opposed to actual types stored in the record).

Synopsis

Documentation

type family FieldAll rs c :: Constraint Source

Assert that all field labels in a given type list satisfy a given constraint.

Equations

FieldAll `[]` c = () 
FieldAll (r : rs) c = (c r, FieldAll rs c) 

data DictProxy c a where Source

A data type that reifies a constraint. Pattern match on the DictProxy constructor to bring the constraint into scope.

Constructors

DictProxy :: c a => DictProxy c a 

getProxy :: DictProxy c a -> Proxy a Source

Obtain a Proxy from a DictProxy, forgetting its constraint.

reifyFieldConstraint :: FieldAll rs c => proxy c -> Rec Proxy rs -> Rec (DictProxy c) rs Source

Given a dummy record and a constraint that applies to all field labels, reify the constraint for each field label.