| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
DataFrame.Typed.Types
Synopsis
- newtype TypedDataFrame (cols :: [(Symbol, Type)]) = TDF {}
- newtype TExpr (cols :: [(Symbol, Type)]) a = TExpr {}
- type family AsTExpr (cols :: [(Symbol, Type)]) e where ...
- class ToTExpr (cols :: [(Symbol, Type)]) e where
- data TSortOrder (cols :: [(Symbol, Type)]) where
- Asc :: forall a (cols :: [(Symbol, Type)]). (Columnable a, Ord a) => TExpr cols a -> TSortOrder cols
- Desc :: forall a (cols :: [(Symbol, Type)]). (Columnable a, Ord a) => TExpr cols a -> TSortOrder cols
- newtype TypedGrouped (keys :: [Symbol]) (cols :: [(Symbol, Type)]) = TGD {}
- data TAgg (keys :: [Symbol]) (cols :: [(Symbol, Type)]) (aggs :: [(Symbol, Type)]) where
- TAggNil :: forall (keys :: [Symbol]) (cols :: [(Symbol, Type)]). TAgg keys cols ('[] :: [(Symbol, Type)])
- TAggCons :: forall a (cols :: [(Symbol, Type)]) (keys :: [Symbol]) (aggs1 :: [(Symbol, Type)]) (name :: Symbol). Columnable a => Text -> TExpr cols a -> TAgg keys cols aggs1 -> TAgg keys cols ('(name, a) ': aggs1)
- taggToNamedExprs :: forall (keys :: [Symbol]) (cols :: [(Symbol, Type)]) (aggs :: [(Symbol, Type)]). TAgg keys cols aggs -> [NamedExpr]
- data These a b
Core phantom-typed wrapper
newtype TypedDataFrame (cols :: [(Symbol, Type)]) Source #
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) Source # | |
Defined in DataFrame.Typed.Types Methods showsPrec :: Int -> TypedDataFrame cols -> ShowS # show :: TypedDataFrame cols -> String # showList :: [TypedDataFrame cols] -> ShowS # | |
| ToDataFrame (TypedDataFrame cols) Source # | |
Defined in DataFrame.Typed.Freeze Methods toDataFrame :: TypedDataFrame cols -> DataFrame Source # | |
| Eq (TypedDataFrame cols) Source # | |
Defined in DataFrame.Typed.Types Methods (==) :: TypedDataFrame cols -> TypedDataFrame cols -> Bool # (/=) :: TypedDataFrame cols -> TypedDataFrame cols -> Bool # | |
Typed expressions (schema-validated)
newtype TExpr (cols :: [(Symbol, Type)]) a Source #
A typed expression validated against schema cols, producing values of type a.
Unlike the untyped 'Expr a', a TExpr can only be constructed through
type-safe combinators (col, lit, arithmetic operations) that verify
column references exist in the schema with the correct type.
Use unTExpr to extract the underlying Expr for delegation to the untyped API.
Lifting untyped expressions into the typed world
type family AsTExpr (cols :: [(Symbol, Type)]) e where ... Source #
The typed counterpart of an untyped expression type for schema cols:
AsTExpr cols (Expr r) = TExpr cols r. Lets a result type follow the frame —
an Expr over a plain frame becomes a TExpr over a typed one.
class ToTExpr (cols :: [(Symbol, Type)]) e where Source #
Lift an untyped expression into its TExpr for schema cols.
Typed sort orders
data TSortOrder (cols :: [(Symbol, Type)]) where Source #
A typed sort order validated against schema cols.
Constructors
| Asc :: forall a (cols :: [(Symbol, Type)]). (Columnable a, Ord a) => TExpr cols a -> TSortOrder cols | |
| Desc :: forall a (cols :: [(Symbol, Type)]). (Columnable a, Ord a) => TExpr cols a -> TSortOrder cols |
Grouped typed dataframe
newtype TypedGrouped (keys :: [Symbol]) (cols :: [(Symbol, Type)]) Source #
A phantom-typed wrapper over GroupedDataFrame.
Constructors
| TGD | |
Fields | |
Typed aggregation builder (Option B)
data TAgg (keys :: [Symbol]) (cols :: [(Symbol, Type)]) (aggs :: [(Symbol, Type)]) where Source #
Internal aggregation chain. Each cons prepends a Column to the
aggs phantom list. End users never construct this directly — they
compose as entries with (.) and let
aggregate apply the composition to
TAggNil.
as @"total" (F.sum salary) . as @"avg_age" (F.mean age)
taggToNamedExprs :: forall (keys :: [Symbol]) (cols :: [(Symbol, Type)]) (aggs :: [(Symbol, Type)]). TAgg keys cols aggs -> [NamedExpr] Source #
Re-export These
Inline replacement for Data.These.These to keep dataframe-core free
of the these package dependency. Only the three constructors and the
derived classes are used internally.
Instances
| Foldable (These a) Source # | |
Defined in DataFrame.Internal.Types Methods fold :: Monoid m => These a m -> m # foldMap :: Monoid m => (a0 -> m) -> These a a0 -> m # foldMap' :: Monoid m => (a0 -> m) -> These a a0 -> m # foldr :: (a0 -> b -> b) -> b -> These a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> These a a0 -> b # foldl :: (b -> a0 -> b) -> b -> These a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> These a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> These a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> These a a0 -> a0 # toList :: These a a0 -> [a0] # elem :: Eq a0 => a0 -> These a a0 -> Bool # maximum :: Ord a0 => These a a0 -> a0 # minimum :: Ord a0 => These a a0 -> a0 # | |
| Traversable (These a) Source # | |
Defined in DataFrame.Internal.Types | |
| Functor (These a) Source # | |
| (Read a, Read b) => Read (These a b) Source # | |
| (Show a, Show b) => Show (These a b) Source # | |
| (Eq a, Eq b) => Eq (These a b) Source # | |
| (Ord a, Ord b) => Ord (These a b) Source # | |