dataframe-th-2.2.0.0: Record-based Template Haskell splices for the dataframe ecosystem.
LicenseMIT
Safe HaskellNone
LanguageHaskell2010

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

Schema inference from an existing DataFrame value

ADT-based schema derivation

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

Instances details
Show (TypedDataFrame cols) 
Instance details

Defined in DataFrame.Typed.Types

ToDataFrame (TypedDataFrame cols) 
Instance details

Defined in DataFrame.Typed.Freeze

Eq (TypedDataFrame cols) 
Instance details

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 #