-- |Given a @'JsonFormat' e a@, produce a @JsonFormat e ('Refined' p a)@ where @p@ is some 'Predicate' from the refined library for @a@.
--
-- This maps to the same JSON as the given 'JsonFormat', but when parsing it will apply 'refine' to assert that the incoming JSON value conforms to the
description: Integration between Aeson and Vinyl/Frames records allowing records to be easily converted to JSON using automatic derivation, explicit formats, or a mix of both.
description:Integration between Aeson and Vinyl/Frames records allowing records to be easily converted to JSON using automatic derivation, explicit formats, or a mix of both.
-- |Project a @'CoRec' f@ into a @'Rec' ('Maybe' ':.' f)@ where only the single @r@ held by the 'CoRec' is 'Just' in the resulting record, and all other
-- |Typeclass which allows folding ala 'foldMap' over a 'Rec', using a 'CoRec' as the accumulator.
classFoldRecsstswhere
-- |Given some combining function, an initial value, and a record, visit each field of the record using the combining function to accumulate the
-- initial value or previous accumulation with the field of the record.
foldRec
::(CoRecfss->CoRecfss->CoRecfss)
->CoRecfss
->Recfts
->CoRecfss
instanceFoldRecss'[]where
foldRec_z_=z
{-# INLINE foldRec #-}
instance(t∈ss,FoldRecssts)=>FoldRecss(t':ts)where
foldRecfz(x:&xs)=foldRecf(z`f`CoValx)xs
{-# INLINE foldRec #-}
-- |'foldRec' for records with at least one field that doesn't require an initial value.
foldRec1
::FoldRec(r':rs)rs
=>(CoRecf(r':rs)->CoRecf(r':rs)->CoRecf(r':rs))
->Recf(r':rs)
->CoRecf(r':rs)
foldRec1f(x:&xs)=foldRecf(CoValx)xs
{-# INLINE foldRec1 #-}
-- |Given a @'Rec' ('Maybe' ':.' f) rs@, yield a @Just coRec@ for the first field which is @Just@, or @Nothing@ if there are no @Just@ fields in the record.
-- |Given a @'Rec' ('Maybe' ':.' f) rs@, yield a @Just coRec@ for the last field which is @Just@, or @Nothing@ if there are no @Just@ fields in the record.
-- |Given some target type @r@ that's a possible value of @'Field' rs@, yield @Just@ if that is indeed the value being stored by the 'Field', or @Nothing@ if
-- |Class with 'Data.Vinyl.rmap' but which gives the natural transformation evidence that the value its working over is contained within the overall record @ss@.
classRecWithContext(ss::[*])(ts::[*])where
-- |Apply a natural transformation from @f@ to @g@ to each field of the given record, except that the natural transformation can be mildly unnatural by having
description: Integration between EKG and Vinyl/Frames records allowing records holding registered metrics to be easily constructed from a type declaration.