dataframe-parsing-1.0.2.1: Shared text/binary parsing helpers for the dataframe ecosystem.
Safe HaskellNone
LanguageHaskell2010

DataFrame.Internal.Schema

Description

Runtime schema representation. The Template-Haskell deriveSchema splice lives in DataFrame.Internal.Schema.TH so this module can be used from packages that do not depend on template-haskell.

Synopsis

Documentation

data SchemaType where Source #

A runtime tag for a column’s element type.

Constructors

SType :: forall a. (Columnable a, Read a) => Proxy a -> SchemaType

Constructor carrying a Proxy of the element type.

Instances

Instances details
Show SchemaType Source #

Show the underlying element type using typeRep.

Examples

Expand
>>> :set -XTypeApplications
>>> show (schemaType @Bool)
"Bool"
Instance details

Defined in DataFrame.Internal.Schema

Eq SchemaType Source #

Two SchemaTypes are equal iff their element types are the same.

Examples

Expand
>>> :set -XTypeApplications
>>> schemaType @Int == schemaType @Int
True
>>> schemaType @Int == schemaType @Integer
False
Instance details

Defined in DataFrame.Internal.Schema

schemaType :: (Columnable a, Read a) => SchemaType Source #

Construct a SchemaType for the given a.

Examples

Expand
>>> :set -XTypeApplications
>>> schemaType @T.Text == schemaType @T.Text
True
>>> show (schemaType @Double)
"Double"

newtype Schema Source #

Logical schema of a DataFrame: a mapping from column names to their element types (SchemaType).

Constructors

Schema 

Fields

  • elements :: Map Text SchemaType

    Mapping from column name to its SchemaType.

    Invariant: keys are unique column names. A missing key means the column is not present in the schema.

Instances

Instances details
Show Schema Source # 
Instance details

Defined in DataFrame.Internal.Schema

Eq Schema Source # 
Instance details

Defined in DataFrame.Internal.Schema

Methods

(==) :: Schema -> Schema -> Bool #

(/=) :: Schema -> Schema -> Bool #

makeSchema :: [(Text, SchemaType)] -> Schema Source #

Construct a Schema from a list of (columnName, schemaType) pairs.