| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
DataFrame.Typed.Types
Synopsis
- newtype TypedDataFrame (cols :: [Type]) = TDF {}
- data Column (name :: Symbol) a
- newtype TExpr (cols :: [Type]) a = TExpr {}
- data TSortOrder (cols :: [Type]) where
- Asc :: forall a (cols :: [Type]). Columnable a => TExpr cols a -> TSortOrder cols
- Desc :: forall a (cols :: [Type]). Columnable a => TExpr cols a -> TSortOrder cols
- newtype TypedGrouped (keys :: [Symbol]) (cols :: [Type]) = TGD {}
- data TAgg (keys :: [Symbol]) (cols :: [Type]) (aggs :: [Type]) where
- taggToNamedExprs :: forall (keys :: [Symbol]) (cols :: [Type]) (aggs :: [Type]). TAgg keys cols aggs -> [NamedExpr]
- data These a b
Core phantom-typed wrapper
newtype TypedDataFrame (cols :: [Type]) Source #
A phantom-typed wrapper over the untyped DataFrame.
The type parameter cols is a type-level list of Column name ty entries
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 # | |
| Eq (TypedDataFrame cols) Source # | |
Defined in DataFrame.Typed.Types Methods (==) :: TypedDataFrame cols -> TypedDataFrame cols -> Bool # (/=) :: TypedDataFrame cols -> TypedDataFrame cols -> Bool # | |
Column phantom type (no constructors)
data Column (name :: Symbol) a Source #
A phantom type that pairs a type-level column name (Symbol)
with its element type. Has no value-level constructors — used
purely at the type level to describe schemas.
Instances
| (KnownSymbol name, Typeable a, Columnable a, KnownSchema rest) => KnownSchema (Column name a ': rest) Source # | |
Defined in DataFrame.Typed.Schema Methods schemaEvidence :: [(Text, SomeTypeRep)] Source # | |
Typed expressions (schema-validated)
newtype TExpr (cols :: [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.
Instances
| (IsString a, Columnable a) => IsString (TExpr cols a) Source # | |
Defined in DataFrame.Typed.Expr Methods fromString :: String -> TExpr cols a # | |
| (Floating a, Columnable a) => Floating (TExpr cols a) Source # | |
Defined in DataFrame.Typed.Expr Methods exp :: TExpr cols a -> TExpr cols a # log :: TExpr cols a -> TExpr cols a # sqrt :: TExpr cols a -> TExpr cols a # (**) :: TExpr cols a -> TExpr cols a -> TExpr cols a # logBase :: TExpr cols a -> TExpr cols a -> TExpr cols a # sin :: TExpr cols a -> TExpr cols a # cos :: TExpr cols a -> TExpr cols a # tan :: TExpr cols a -> TExpr cols a # asin :: TExpr cols a -> TExpr cols a # acos :: TExpr cols a -> TExpr cols a # atan :: TExpr cols a -> TExpr cols a # sinh :: TExpr cols a -> TExpr cols a # cosh :: TExpr cols a -> TExpr cols a # tanh :: TExpr cols a -> TExpr cols a # asinh :: TExpr cols a -> TExpr cols a # acosh :: TExpr cols a -> TExpr cols a # atanh :: TExpr cols a -> TExpr cols a # log1p :: TExpr cols a -> TExpr cols a # expm1 :: TExpr cols a -> TExpr cols a # | |
| (Num a, Columnable a) => Num (TExpr cols a) Source # | |
Defined in DataFrame.Typed.Expr Methods (+) :: TExpr cols a -> TExpr cols a -> TExpr cols a # (-) :: TExpr cols a -> TExpr cols a -> TExpr cols a # (*) :: TExpr cols a -> TExpr cols a -> TExpr cols a # negate :: TExpr cols a -> TExpr cols a # abs :: TExpr cols a -> TExpr cols a # signum :: TExpr cols a -> TExpr cols a # fromInteger :: Integer -> TExpr cols a # | |
| (Fractional a, Columnable a) => Fractional (TExpr cols a) Source # | |
Typed sort orders
data TSortOrder (cols :: [Type]) where Source #
A typed sort order validated against schema cols.
Constructors
| Asc :: forall a (cols :: [Type]). Columnable a => TExpr cols a -> TSortOrder cols | |
| Desc :: forall a (cols :: [Type]). Columnable a => TExpr cols a -> TSortOrder cols |
Grouped typed dataframe
newtype TypedGrouped (keys :: [Symbol]) (cols :: [Type]) Source #
A phantom-typed wrapper over GroupedDataFrame.
Constructors
| TGD | |
Fields | |
Typed aggregation builder (Option B)
data TAgg (keys :: [Symbol]) (cols :: [Type]) (aggs :: [Type]) where Source #
A typed aggregation builder (Option B).
Accumulates NamedExpr values at the term level while building
the result schema at the type level. Each agg call prepends a
Column to the aggs phantom list.
Usage:
agg @"total" (F.sum salary) $ agg @"avg_age" (F.mean age) $ aggNil
taggToNamedExprs :: forall (keys :: [Symbol]) (cols :: [Type]) (aggs :: [Type]). TAgg keys cols aggs -> [NamedExpr] Source #
Re-export These
The These type represents values with two non-exclusive possibilities.
This can be useful to represent combinations of two values, where the
combination is defined if either input is. Algebraically, the type
represents These A B(A + B + AB), which doesn't factor easily into
sums and products--a type like is unclear and
awkward to use.Either A (B, Maybe A)
These has straightforward instances of Functor, Monad, &c., and
behaves like a hybrid error/writer monad, as would be expected.
For zipping and unzipping of structures with These values, see
Data.Align.
Instances
| FromJSON2 These | Since: aeson-1.5.1.0 | ||||
Defined in Data.Aeson.Types.FromJSON Methods liftParseJSON2 :: Maybe a -> (Value -> Parser a) -> (Value -> Parser [a]) -> Maybe b -> (Value -> Parser b) -> (Value -> Parser [b]) -> Value -> Parser (These a b) # liftParseJSONList2 :: Maybe a -> (Value -> Parser a) -> (Value -> Parser [a]) -> Maybe b -> (Value -> Parser b) -> (Value -> Parser [b]) -> Value -> Parser [These a b] # liftOmittedField2 :: Maybe a -> Maybe b -> Maybe (These a b) # | |||||
| Assoc These | Since: these-0.8 | ||||
| Swap These | Since: these-0.8 | ||||
Defined in Data.These | |||||
| Bifoldable These | |||||
| Bifoldable1 These | Since: these-1.2 | ||||
Defined in Data.These | |||||
| Bifunctor These | |||||
| Bitraversable These | |||||
Defined in Data.These Methods bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> These a b -> f (These c d) # | |||||
| Eq2 These | Since: these-1.1.1 | ||||
| Ord2 These | Since: these-1.1.1 | ||||
Defined in Data.These | |||||
| Read2 These | Since: these-1.1.1 | ||||
Defined in Data.These Methods liftReadsPrec2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> Int -> ReadS (These a b) # liftReadList2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> ReadS [These a b] # liftReadPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec (These a b) # liftReadListPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec [These a b] # | |||||
| Show2 These | Since: these-1.1.1 | ||||
| NFData2 These | Since: these-1.1.1 | ||||
Defined in Data.These | |||||
| Hashable2 These | Since: these-1.1.1 | ||||
Defined in Data.These | |||||
| Generic1 (These a :: Type -> Type) | |||||
Defined in Data.These Associated Types
| |||||
| FromJSON a => FromJSON1 (These a) | Since: aeson-1.5.1.0 | ||||
Defined in Data.Aeson.Types.FromJSON | |||||
| Foldable (These a) | |||||
Defined in Data.These 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 # | |||||
| Eq a => Eq1 (These a) | Since: these-1.1.1 | ||||
| Ord a => Ord1 (These a) | Since: these-1.1.1 | ||||
Defined in Data.These | |||||
| Read a => Read1 (These a) | Since: these-1.1.1 | ||||
Defined in Data.These Methods liftReadsPrec :: (Int -> ReadS a0) -> ReadS [a0] -> Int -> ReadS (These a a0) # liftReadList :: (Int -> ReadS a0) -> ReadS [a0] -> ReadS [These a a0] # liftReadPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec (These a a0) # liftReadListPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec [These a a0] # | |||||
| Show a => Show1 (These a) | Since: these-1.1.1 | ||||
| Traversable (These a) | |||||
| Semigroup a => Applicative (These a) | |||||
| Functor (These a) | |||||
| Semigroup a => Monad (These a) | |||||
| NFData a => NFData1 (These a) | Since: these-1.1.1 | ||||
Defined in Data.These | |||||
| Hashable a => Hashable1 (These a) | Since: these-1.1.1 | ||||
Defined in Data.These | |||||
| (FromJSON a, FromJSON b) => FromJSON (These a b) | Since: aeson-1.5.1.0 | ||||
Defined in Data.Aeson.Types.FromJSON | |||||
| (Data a, Data b) => Data (These a b) | |||||
Defined in Data.These Methods gfoldl :: (forall d b0. Data d => c (d -> b0) -> d -> c b0) -> (forall g. g -> c g) -> These a b -> c (These a b) # gunfold :: (forall b0 r. Data b0 => c (b0 -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (These a b) # toConstr :: These a b -> Constr # dataTypeOf :: These a b -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (These a b)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (These a b)) # gmapT :: (forall b0. Data b0 => b0 -> b0) -> These a b -> These a b # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> These a b -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> These a b -> r # gmapQ :: (forall d. Data d => d -> u) -> These a b -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> These a b -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> These a b -> m (These a b) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> These a b -> m (These a b) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> These a b -> m (These a b) # | |||||
| (Semigroup a, Semigroup b) => Semigroup (These a b) | |||||
| Generic (These a b) | |||||
Defined in Data.These Associated Types
| |||||
| (Read a, Read b) => Read (These a b) | |||||
| (Show a, Show b) => Show (These a b) | |||||
| (Binary a, Binary b) => Binary (These a b) | Since: these-0.7.1 | ||||
| (NFData a, NFData b) => NFData (These a b) | Since: these-0.7.1 | ||||
Defined in Data.These | |||||
| (Eq a, Eq b) => Eq (These a b) | |||||
| (Ord a, Ord b) => Ord (These a b) | |||||
| (Hashable a, Hashable b) => Hashable (These a b) | |||||
Defined in Data.These | |||||
| type Rep1 (These a :: Type -> Type) | |||||
Defined in Data.These type Rep1 (These a :: Type -> Type) = D1 ('MetaData "These" "Data.These" "these-1.2.1-LfQCaHJJi4Z34EHcD2riJU" 'False) (C1 ('MetaCons "This" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: (C1 ('MetaCons "That" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1) :+: C1 ('MetaCons "These" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1))) | |||||
| type Rep (These a b) | |||||
Defined in Data.These type Rep (These a b) = D1 ('MetaData "These" "Data.These" "these-1.2.1-LfQCaHJJi4Z34EHcD2riJU" 'False) (C1 ('MetaCons "This" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: (C1 ('MetaCons "That" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 b)) :+: C1 ('MetaCons "These" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 b)))) | |||||