vinyl-0.4.3: Extensible Records

Safe HaskellNone
LanguageHaskell2010

Data.Vinyl.Operators

Synopsis

Documentation

(<<$>>) :: (forall x. f x -> g x) -> Rec el f rs -> Rec el g rs infixl 8 Source

(<<*>>) :: Rec el (Lift (->) f g) rs -> Rec el f rs -> Rec el g rs infixl 8 Source

(<+>) :: Rec el f as -> Rec el f bs -> Rec el f (as ++ bs) infixr 5 Source

Append for records.

type family as ++ bs :: [k] Source

Append for type-level lists.

Instances

type (++) k ([] k) bs = bs 
type (++) k ((:) k a as) bs = (:) k a ((++) k as bs) 

class RecApplicative rs where Source

Methods

rpure :: (forall x. f x) -> Rec el f rs Source

Instances

RecApplicative k ([] k) 
RecApplicative k rs => RecApplicative k ((:) k f rs) 

rtraverse :: Applicative h => (forall x. f x -> h (g x)) -> Rec el f rs -> h (Rec el g rs) Source

rdist :: Applicative f => Rec el f rs -> f (PlainRec el rs) Source

rdistLazy :: Applicative f => Rec el f rs -> f (LazyPlainRec el rs) Source

class FoldRec r a where Source

Methods

foldRec :: (a -> b -> b) -> b -> r -> b Source

Instances

FoldRec (Rec k el f ([] k)) a 
((~) * t (($) * k el r), FoldRec (Rec k el f rs) (f t)) => FoldRec (Rec k el f ((:) k r rs)) (f t) 

recToList :: FoldRec (Rec el f rs) (f t) => Rec el f rs -> [f t] Source

Accumulates a homogenous record into a list

showWithNames :: RecAll el f rs Show => PlainRec (Const String) rs -> Rec el f rs -> String Source

rshow :: (Implicit (PlainRec (Const String) rs), RecAll el f rs Show) => Rec el f rs -> String Source