Frames-0.7.0: Data frames For working with tabular data files

Safe HaskellNone
LanguageHaskell2010

Frames.RecF

Synopsis

Documentation

rappend :: Rec f as -> Rec f bs -> Rec f (as ++ bs) #

Two records may be pasted together.

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

A record may be traversed with respect to its interpretation functor. This can be used to yank (some or all) effects from the fields of the record to the outside of the record.

rdel :: CanDelete r rs => Rec f rs -> Rec f (RDelete r rs) Source #

Delete a field from a record

type CanDelete r rs = (RElem r rs (RIndex r rs), RDelete r rs rs) Source #

A constraint that a field can be deleted from a record.

type AllCols c ts = AllConstrained c (UnColumn ts) Source #

Enforce a constraint on the payload type of each column.

type family UnColumn (ts :: [(Symbol, *)]) where ... Source #

Strip the column information from each element of a list of types.

Equations

UnColumn '[] = '[] 
UnColumn ((s :-> t) ': ts) = t ': UnColumn ts 

class StripFieldNames (ts :: [(Symbol, Type)]) where #

Facilities for removing and replacing the type-level label, or column name, part of a record.

Methods

stripNames :: Rec ElField ts -> Rec Identity (Unlabeled ts) #

stripNames' :: Functor f => Rec (f :. ElField) ts -> Rec f (Unlabeled ts) #

withNames :: Rec Identity (Unlabeled ts) -> Rec ElField ts #

withNames' :: Functor f => Rec f (Unlabeled ts) -> Rec (f :. ElField) ts #

Instances
StripFieldNames ([] :: [(Symbol, Type)]) 
Instance details

Defined in Data.Vinyl.Derived

Methods

stripNames :: Rec ElField [] -> Rec Identity (Unlabeled []) #

stripNames' :: Functor f => Rec (f :. ElField) [] -> Rec f (Unlabeled []) #

withNames :: Rec Identity (Unlabeled []) -> Rec ElField [] #

withNames' :: Functor f => Rec f (Unlabeled []) -> Rec (f :. ElField) [] #

(KnownSymbol s, StripFieldNames ts) => StripFieldNames ((,) s t ': ts) 
Instance details

Defined in Data.Vinyl.Derived

Methods

stripNames :: Rec ElField ((s, t) ': ts) -> Rec Identity (Unlabeled ((s, t) ': ts)) #

stripNames' :: Functor f => Rec (f :. ElField) ((s, t) ': ts) -> Rec f (Unlabeled ((s, t) ': ts)) #

withNames :: Rec Identity (Unlabeled ((s, t) ': ts)) -> Rec ElField ((s, t) ': ts) #

withNames' :: Functor f => Rec f (Unlabeled ((s, t) ': ts)) -> Rec (f :. ElField) ((s, t) ': ts) #

mapMono :: (AllAre a (Unlabeled ts), StripFieldNames ts, StripFieldNames (ReplaceAllSnd b ts), ReplaceAll b (Unlabeled ts) ~ Unlabeled (ReplaceAllSnd b ts)) => (a -> b) -> Rec ElField ts -> Rec ElField (ReplaceAllSnd b ts) Source #

Map a function across a homogeneous Rec of named values. This is a thin wrapper over mapMonoV.

type family ColFun f x where ... Source #

A type function to convert a 'Rec f' to a 'Rec (g :. f)'. ColFun f (Record rs) = Rec (f :. ElField) rs.

Equations

ColFun f (Rec g rs) = Rec (f :. g) rs 

class ColumnHeaders (cs :: [(Symbol, *)]) Source #

Minimal complete definition

columnHeaders

Instances
ColumnHeaders ([] :: [(Symbol, Type)]) Source # 
Instance details

Defined in Frames.RecF

Methods

columnHeaders :: proxy (Rec f []) -> [String] Source #

(ColumnHeaders cs, KnownSymbol s) => ColumnHeaders ((s :-> c) ': cs) Source # 
Instance details

Defined in Frames.RecF

Methods

columnHeaders :: proxy (Rec f ((s :-> c) ': cs)) -> [String] Source #

columnHeaders :: ColumnHeaders cs => proxy (Rec f cs) -> [String] Source #

Return the column names for a record.