| License | MIT |
|---|---|
| Safe Haskell | None |
| Language | Haskell2010 |
DataFrame.Typed.TH.Records
Description
Record-based typed-API schema derivation. The IO-agnostic core of the
DataFrame.Typed.TH family. CSV-file-based derivation lives in
DataFrame.Typed.TH.CSV (in dataframe-csv-th).
Synopsis
- deriveSchema :: String -> DataFrame -> DecsQ
- deriveSchemaFromType :: Name -> DecsQ
- deriveSchemaFromTypeWith :: SchemaOptions -> Name -> DecsQ
- deriveSchemaValues :: Name -> DecsQ
- data SchemaOptions = SchemaOptions {}
- defaultSchemaOptions :: SchemaOptions
- camelToSnake :: String -> String
- data TypedDataFrame (cols :: [(Symbol, Type)])
- getSchemaInfo :: DataFrame -> [(Text, String)]
- findDuplicate :: Eq a => [a] -> Maybe a
Schema inference from an existing DataFrame value
ADT-based schema derivation
deriveSchemaFromType :: Name -> DecsQ Source #
deriveSchemaFromTypeWith :: SchemaOptions -> Name -> DecsQ Source #
deriveSchemaValues :: Name -> DecsQ Source #
Derive an untyped Schema value plus per-column Expr
accessors from a record type. The value-level companion to
deriveSchemaFromType: $(deriveSchemaValues ''Order) generates orderSchema.
data SchemaOptions Source #
Options controlling deriveSchemaFromTypeWith.
Constructors
| SchemaOptions | |
Fields
| |
camelToSnake :: String -> String #
Convert a camelCase identifier to snake_case.
>>>camelToSnake "orderId""order_id">>>camelToSnake "amountUS""amount_u_s">>>camelToSnake "region""region"
Re-export for TH splices
data TypedDataFrame (cols :: [(Symbol, Type)]) #
A phantom-typed wrapper over the untyped DataFrame.
The type parameter cols is a type-level list of '(name, ty) pairs
that tracks the schema at compile time. All operations delegate to the
untyped core at runtime and update the phantom type at compile time.
Instances
| Show (TypedDataFrame cols) | |
Defined in DataFrame.Typed.Types Methods showsPrec :: Int -> TypedDataFrame cols -> ShowS # show :: TypedDataFrame cols -> String # showList :: [TypedDataFrame cols] -> ShowS # | |
| ToDataFrame (TypedDataFrame cols) | |
Defined in DataFrame.Typed.Freeze Methods toDataFrame :: TypedDataFrame cols -> DataFrame # | |
| Eq (TypedDataFrame cols) | |
Defined in DataFrame.Typed.Types Methods (==) :: TypedDataFrame cols -> TypedDataFrame cols -> Bool # (/=) :: TypedDataFrame cols -> TypedDataFrame cols -> Bool # | |
Shared helpers (used by sibling TH modules)
findDuplicate :: Eq a => [a] -> Maybe a Source #