Apply a typeclass method to each field of a FieldRec. This is a specialization of rmapMethod.
Modulevinyl-0.14.3Haskell2010
Data.Vinyl
- 4 types
- 5 classes
- 13 values
- Packagevinyl-0.14.3
- Exports27
- LanguageHaskell2010
- LicenceMIT
- SourceMethod.hs
module Data.Vinyl.Core
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.
Push an outer layer of interpretation functor into each named field.
Like rtraverseIn, but the function between functors may be constrained.
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
rmapMethod :: (forall (a :: u). c (PayloadType f a) => f a -> g a) -> Rec f ts -> Rec g ts
Instances2RecMapMethod
RecMapMethod c f '[]Defined in vinyl-0.14.3 · Data.Vinyl.Class.Method(c (PayloadType f t), RecMapMethod c f ts) => RecMapMethod c f (t ': ts)Defined in vinyl-0.14.3 · Data.Vinyl.Class.Method
Generate a record from fields derived from type class instances.
Methods
rpointMethod :: (forall (a :: u). c (f a) => f a) -> Rec f ts
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
An array-backed extensible record with constant-time field access.
Instances9RecSubset, RecElem, Eq, Ord, Show, RecElemFCtx, …
(is ~ RImage rs ss, IndexWitnesses is, NatToInt (RLength rs)) => RecSubset ARec rs ss isDefined in vinyl-0.14.3 · Data.Vinyl.ARec.InternalRecElem ARec t t' (t ': ts) (t' ': ts) 'ZDefined in vinyl-0.14.3 · Data.Vinyl.ARec.Internal(RIndex t (s ': ts) ~ 'S i, NatToInt i, RecElem ARec t t' ts ts' i) => RecElem ARec t t' (s ': ts) (s ': ts') ('S i)Defined in vinyl-0.14.3 · Data.Vinyl.ARec.Internal(RPureConstrained (IndexableField rs) rs, RecApplicative rs, Eq (Rec f rs)) => Eq (ARec f rs)Defined in vinyl-0.14.3 · Data.Vinyl.ARec.Internal(RPureConstrained (IndexableField rs) rs, RecApplicative rs, Ord (Rec f rs)) => Ord (ARec f rs)Defined in vinyl-0.14.3 · Data.Vinyl.ARec.Internal(RPureConstrained (IndexableField rs) rs, RecApplicative rs, Show (Rec f rs)) => Show (ARec f rs)Defined in vinyl-0.14.3 · Data.Vinyl.ARec.Internaltype RecElemFCtx ARec f = ()Defined in vinyl-0.14.3 · Data.Vinyl.ARec.Internaltype RecElemFCtx ARec f = ()Defined in vinyl-0.14.3 · Data.Vinyl.ARec.Internaltype RecSubsetFCtx ARec f = ()Defined in vinyl-0.14.3 · Data.Vinyl.ARec.Internal
module Data.Vinyl.Derived
Build a FieldRec from a tuple of ElField values.
Convert an XRec to a tuple. Useful for pattern matching on an entire record.
Build an XRec from a tuple.
Instances19Eq, Floating, Fractional, Num, Ord, Real, …
Eq t => Eq (ElField '(s, t))Defined in vinyl-0.14.3 · Data.Vinyl.Functor(Floating t, KnownSymbol s) => Floating (ElField '(s, t))Defined in vinyl-0.14.3 · Data.Vinyl.Functor(Fractional t, KnownSymbol s) => Fractional (ElField '(s, t))Defined in vinyl-0.14.3 · Data.Vinyl.Functor(Num t, KnownSymbol s) => Num (ElField '(s, t))Defined in vinyl-0.14.3 · Data.Vinyl.FunctorOrd t => Ord (ElField '(s, t))Defined in vinyl-0.14.3 · Data.Vinyl.Functor(Real t, KnownSymbol s) => Real (ElField '(s, t))Defined in vinyl-0.14.3 · Data.Vinyl.Functor(RealFrac t, KnownSymbol s) => RealFrac (ElField '(s, t))Defined in vinyl-0.14.3 · Data.Vinyl.Functor(Show t, KnownSymbol s) => Show (ElField '(s, t))Defined in vinyl-0.14.3 · Data.Vinyl.FunctorKnownSymbol s => Generic (ElField '(s, a))Defined in vinyl-0.14.3 · Data.Vinyl.FunctorSemigroup t => Semigroup (ElField '(s, t))Defined in vinyl-0.14.3 · Data.Vinyl.Functor(KnownSymbol s, Monoid t) => Monoid (ElField '(s, t))Defined in vinyl-0.14.3 · Data.Vinyl.Functor(KnownSymbol s, Storable t) => Storable (ElField '(s, t))Defined in vinyl-0.14.3 · Data.Vinyl.FunctorKnownSymbol s => IsoHKD ElField '(s, a)Defined in vinyl-0.14.3 · Data.Vinyl.XRecWork with values of type ElField
'(s,a)as if they were of typea.(i ~ RIndex t ts, NatToInt i, FieldOffset ElField ts t, Storable (Rec ElField ts), AllConstrained (FieldOffset ElField ts) ts) => RecElem (SRec2 ElField) t t ts ts iDefined in vinyl-0.14.3 · Data.Vinyl.SRec(is ~ RImage rs ss, RecSubset Rec rs ss is, Storable (Rec ElField rs), Storable (Rec ElField ss), RPureConstrained (FieldOffset ElField ss) rs, RPureConstrained (FieldOffset ElField rs) rs, RFoldMap rs, RMap rs, RApply rs) => RecSubset (SRec2 ElField) rs ss isDefined in vinyl-0.14.3 · Data.Vinyl.SRectype Rep (ElField '(s, a)) = C1 ('MetaCons s 'PrefixI 'False) (Rec0 a)Defined in vinyl-0.14.3 · Data.Vinyl.Functortype RecElemFCtx (SRec2 ElField) f = f ~ ElFieldDefined in vinyl-0.14.3 · Data.Vinyl.SRectype RecSubsetFCtx (SRec2 ElField) f = f ~ ElFieldDefined in vinyl-0.14.3 · Data.Vinyl.SRectype HKD ElField '(s, a) = aDefined in vinyl-0.14.3 · Data.Vinyl.XRec
module Data.Vinyl.Lens
Instances4RecElem, RecSubset, RecElemFCtx, RecSubsetFCtx
(i ~ RIndex t ts, NatToInt i, FieldOffset ElField ts t, Storable (Rec ElField ts), AllConstrained (FieldOffset ElField ts) ts) => RecElem SRec t t ts ts iDefined in vinyl-0.14.3 · Data.Vinyl.SRec(is ~ RImage rs ss, RecSubset Rec rs ss is, Storable (Rec ElField rs), Storable (Rec ElField ss), RPureConstrained (FieldOffset ElField ss) rs, RPureConstrained (FieldOffset ElField rs) rs, RFoldMap rs, RMap rs, RApply rs) => RecSubset SRec rs ss isDefined in vinyl-0.14.3 · Data.Vinyl.SRectype RecElemFCtx SRec f = f ~ ElFieldDefined in vinyl-0.14.3 · Data.Vinyl.SRectype RecSubsetFCtx SRec f = f ~ ElFieldDefined in vinyl-0.14.3 · Data.Vinyl.SRec
This is rmap for XRec. We apply a natural transformation
between interpretation functors to transport a record value between
interpretations.
Like rapply: record of components f r -> g r may be applied
to a record of f to get a record of g.