| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
DataFrame.Internal.Expression
Synopsis
- class Typeable op => UnaryOp (op :: Type -> Type -> Type) where
- class Typeable op => BinaryOp (op :: Type -> Type -> Type -> Type) where
- binaryFn :: op a b c -> a -> b -> c
- binaryName :: op a b c -> Text
- binarySymbol :: op a b c -> Maybe Text
- binaryCommutative :: op a b c -> Bool
- binaryPrecedence :: op a b c -> Int
- data UnUDF a b = MkUnaryOp {}
- data BinUDF a b c = MkBinaryOp {
- binaryFn :: a -> b -> c
- binaryName :: Text
- binarySymbol :: Maybe Text
- binaryCommutative :: Bool
- binaryPrecedence :: Int
- data MeanAcc = MeanAcc !Double !Int
- data AggStrategy a b where
- CollectAgg :: forall (v :: Type -> Type) b a. (Vector v b, Typeable v) => Text -> (v b -> a) -> AggStrategy a b
- FoldAgg :: forall a b. Text -> Maybe a -> (a -> b -> a) -> AggStrategy a b
- MergeAgg :: forall acc b a. Columnable acc => Text -> acc -> (acc -> b -> acc) -> (acc -> acc -> acc) -> (acc -> a) -> AggStrategy a b
- data Expr a where
- Col :: forall a. Columnable a => Text -> Expr a
- CastWith :: forall a1 a. (Columnable a1, Columnable a, Read a1) => Text -> Text -> (Either String a1 -> a) -> Expr a
- CastExprWith :: forall a1 a src. (Columnable a1, Columnable a, Columnable src, Read a1) => Text -> (Either String a1 -> a) -> Expr src -> Expr a
- Lit :: forall a. Columnable a => a -> Expr a
- Unary :: forall (op :: Type -> Type -> Type) a b. (UnaryOp op, Columnable a, Columnable b) => op b a -> Expr b -> Expr a
- Binary :: forall (op :: Type -> Type -> Type -> Type) c b a. (BinaryOp op, Columnable c, Columnable b, Columnable a) => op c b a -> Expr c -> Expr b -> Expr a
- If :: forall a. Columnable a => Expr Bool -> Expr a -> Expr a -> Expr a
- Agg :: forall a b. (Columnable a, Columnable b) => AggStrategy a b -> Expr b -> Expr a
- Over :: forall a. Columnable a => [Text] -> Expr a -> Expr a
- data UExpr where
- UExpr :: forall a. Columnable a => Expr a -> UExpr
- toUExpr :: Columnable a => Expr a -> UExpr
- fromUExpr :: Columnable a => UExpr -> Maybe (Expr a)
- type NamedExpr = (Text, UExpr)
- toNamedExpr :: Columnable a => Text -> Expr a -> NamedExpr
- add :: (Num a, Columnable a) => Expr a -> Expr a -> Expr a
- sub :: (Num a, Columnable a) => Expr a -> Expr a -> Expr a
- mult :: (Num a, Columnable a) => Expr a -> Expr a -> Expr a
- divide :: (Fractional a, Columnable a) => Expr a -> Expr a -> Expr a
- normalize :: (Show a, Typeable a) => Expr a -> Expr a
- compareExpr :: Expr a -> Expr a -> Ordering
- eqExpr :: Columnable a => Expr a -> Expr a -> Bool
- replaceExpr :: (Columnable a, Columnable b, Columnable c) => Expr a -> Expr b -> Expr c -> Expr c
- substituteColumns :: Columnable a => Map Text UExpr -> Expr a -> Expr a
- eSize :: Expr a -> Int
- getColumns :: Expr a -> [Text]
- prettyPrint :: Expr a -> String
- prettyPrintWidth :: Int -> Expr a -> String
Documentation
class Typeable op => UnaryOp (op :: Type -> Type -> Type) where Source #
Operators are an open typeclass: built-ins get their own Typeable type so the
simplifier can match them by cast, and users can add instances. The generic
UnUDF/BinUDF carriers cover UDFs, dynamic-named, and arithmetic ops.
class Typeable op => BinaryOp (op :: Type -> Type -> Type -> Type) where Source #
Minimal complete definition
Methods
binaryFn :: op a b c -> a -> b -> c Source #
binaryName :: op a b c -> Text Source #
binarySymbol :: op a b c -> Maybe Text Source #
binaryCommutative :: op a b c -> Bool Source #
binaryPrecedence :: op a b c -> Int Source #
Constructors
| MkBinaryOp | |
Fields
| |
data AggStrategy a b where Source #
Constructors
| CollectAgg :: forall (v :: Type -> Type) b a. (Vector v b, Typeable v) => Text -> (v b -> a) -> AggStrategy a b | |
| FoldAgg :: forall a b. Text -> Maybe a -> (a -> b -> a) -> AggStrategy a b | |
| MergeAgg :: forall acc b a. Columnable acc => Text -> acc -> (acc -> b -> acc) -> (acc -> acc -> acc) -> (acc -> a) -> AggStrategy a b |
Constructors
| Col :: forall a. Columnable a => Text -> Expr a | |
| CastWith :: forall a1 a. (Columnable a1, Columnable a, Read a1) => Text -> Text -> (Either String a1 -> a) -> Expr a | |
| CastExprWith :: forall a1 a src. (Columnable a1, Columnable a, Columnable src, Read a1) => Text -> (Either String a1 -> a) -> Expr src -> Expr a | |
| Lit :: forall a. Columnable a => a -> Expr a | |
| Unary :: forall (op :: Type -> Type -> Type) a b. (UnaryOp op, Columnable a, Columnable b) => op b a -> Expr b -> Expr a | |
| Binary :: forall (op :: Type -> Type -> Type -> Type) c b a. (BinaryOp op, Columnable c, Columnable b, Columnable a) => op c b a -> Expr c -> Expr b -> Expr a | |
| If :: forall a. Columnable a => Expr Bool -> Expr a -> Expr a -> Expr a | |
| Agg :: forall a b. (Columnable a, Columnable b) => AggStrategy a b -> Expr b -> Expr a | |
| Over :: forall a. Columnable a => [Text] -> Expr a -> Expr a |
Instances
| ToTExpr cols (Expr r) Source # | |
| (IsString a, Columnable a) => IsString (Expr a) Source # | |
Defined in DataFrame.Internal.Expression Methods fromString :: String -> Expr a # | |
| (Floating a, Columnable a) => Floating (Expr a) Source # | |
| (Num a, Columnable a) => Num (Expr a) Source # | |
| (Fractional a, Columnable a) => Fractional (Expr a) Source # | |
| Show a => Show (Expr a) Source # | |
Constructors
| UExpr :: forall a. Columnable a => Expr a -> UExpr |
toNamedExpr :: Columnable a => Text -> Expr a -> NamedExpr Source #
divide :: (Fractional a, Columnable a) => Expr a -> Expr a -> Expr a Source #
replaceExpr :: (Columnable a, Columnable b, Columnable c) => Expr a -> Expr b -> Expr c -> Expr c Source #
substituteColumns :: Columnable a => Map Text UExpr -> Expr a -> Expr a Source #
getColumns :: Expr a -> [Text] Source #
prettyPrint :: Expr a -> String Source #
Render an expression as readable, width-aware pseudo-code at the default
width (defaultWidth). See prettyPrintWidth to control wrapping.