Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- unpackNoOp :: Unpack (record (Maybe :. ElField) rs) (record (Maybe :. ElField) rs)
- unpackFilterRow :: (record (Maybe :. ElField) rs -> Bool) -> Unpack (record (Maybe :. ElField) rs) (record (Maybe :. ElField) rs)
- unpackFilterOnField :: forall t rs record. (KnownField t, ElemOf rs t, RecGetFieldC t record Maybe rs) => (Maybe (Snd t) -> Bool) -> Unpack (record (Maybe :. ElField) rs) (record (Maybe :. ElField) rs)
- unpackGoodRows :: forall cs rs record. RCastC cs rs record Maybe => (record (Maybe :. ElField) cs -> Bool) -> Unpack (record (Maybe :. ElField) rs) (record (Maybe :. ElField) rs)
- unpackGoodRecRows :: forall cs rs. RCastC cs rs Rec Maybe => Unpack (Rec (Maybe :. ElField) rs) (Rec (Maybe :. ElField) rs)
- assignKeysAndData :: forall ks cs rs record. (RCastC ks rs record Maybe, RCastC cs rs record Maybe) => Assign (record (Maybe :. ElField) ks) (record (Maybe :. ElField) rs) (record (Maybe :. ElField) cs)
- splitOnKeys :: forall ks rs cs record. (RCastC ks rs record Maybe, RCastC cs rs record Maybe, cs ~ RDeleteAll ks rs) => Assign (record (Maybe :. ElField) ks) (record (Maybe :. ElField) rs) (record (Maybe :. ElField) cs)
- assignKeys :: forall ks rs record. RCastC ks rs record Maybe => Assign (record (Maybe :. ElField) ks) (record (Maybe :. ElField) rs) (record (Maybe :. ElField) rs)
- reduceAndAddKey :: forall ks cs x record. (IsoRec ks record Maybe, IsoRec cs record Maybe, IsoRec (ks ++ cs) record Maybe, RecVec (ks ++ cs)) => (forall h. Foldable h => h x -> record (Maybe :. ElField) cs) -> Reduce (record (Maybe :. ElField) ks) x (record (Maybe :. ElField) (ks ++ cs))
- foldAndAddKey :: (IsoRec ks record Maybe, IsoRec cs record Maybe, IsoRec (ks ++ cs) record Maybe, RecVec (ks ++ cs)) => Fold x (record (Maybe :. ElField) cs) -> Reduce (record (Maybe :. ElField) ks) x (record (Maybe :. ElField) (ks ++ cs))
- makeRecsWithKey :: (Functor g, Foldable g, IsoRec ks record Maybe, IsoRec as record Maybe, IsoRec (ks ++ as) record Maybe, RecVec (ks ++ as)) => (y -> record (Maybe :. ElField) as) -> Reduce (record (Maybe :. ElField) ks) x (g y) -> Reduce (record (Maybe :. ElField) ks) x (g (record (Maybe :. ElField) (ks ++ as)))
- makeRecsWithKeyM :: (Monad m, Functor g, Foldable g, IsoRec ks record Maybe, IsoRec as record Maybe, IsoRec (ks ++ as) record Maybe, RecVec (ks ++ as)) => (y -> record (Maybe :. ElField) as) -> ReduceM m (record (Maybe :. ElField) ks) x (g y) -> ReduceM m (record (Maybe :. ElField) ks) x (g (record (Maybe :. ElField) (ks ++ as)))
Documentation
unpackNoOp :: Unpack (record (Maybe :. ElField) rs) (record (Maybe :. ElField) rs) Source #
Don't do anything
unpackFilterRow :: (record (Maybe :. ElField) rs -> Bool) -> Unpack (record (Maybe :. ElField) rs) (record (Maybe :. ElField) rs) Source #
Filter records using a function on the entire record.
unpackFilterOnField :: forall t rs record. (KnownField t, ElemOf rs t, RecGetFieldC t record Maybe rs) => (Maybe (Snd t) -> Bool) -> Unpack (record (Maybe :. ElField) rs) (record (Maybe :. ElField) rs) Source #
Filter records based on a condition on only one field in the row. Will usually require a Type Application to indicate which field.
unpackGoodRows :: forall cs rs record. RCastC cs rs record Maybe => (record (Maybe :. ElField) cs -> Bool) -> Unpack (record (Maybe :. ElField) rs) (record (Maybe :. ElField) rs) Source #
An unpack step which specifies a subset of columns, cs,
(via a type-application) and then filters a Rec (Maybe :. Elfield) rs
to only rows which have all good data in that subset.
unpackGoodRecRows :: forall cs rs. RCastC cs rs Rec Maybe => Unpack (Rec (Maybe :. ElField) rs) (Rec (Maybe :. ElField) rs) Source #
assignKeysAndData :: forall ks cs rs record. (RCastC ks rs record Maybe, RCastC cs rs record Maybe) => Assign (record (Maybe :. ElField) ks) (record (Maybe :. ElField) rs) (record (Maybe :. ElField) cs) Source #
Assign both keys and data cols. Uses type applications to specify them if they cannot be inferred. Keys usually can't. Data sometimes can.
splitOnKeys :: forall ks rs cs record. (RCastC ks rs record Maybe, RCastC cs rs record Maybe, cs ~ RDeleteAll ks rs) => Assign (record (Maybe :. ElField) ks) (record (Maybe :. ElField) rs) (record (Maybe :. ElField) cs) Source #
Assign keys and leave the rest of the columns, excluding the keys, in the data passed to reduce.
assignKeys :: forall ks rs record. RCastC ks rs record Maybe => Assign (record (Maybe :. ElField) ks) (record (Maybe :. ElField) rs) (record (Maybe :. ElField) rs) Source #
Assign keys and leave all columns, including the keys, in the data passed to reduce.
:: (IsoRec ks record Maybe, IsoRec cs record Maybe, IsoRec (ks ++ cs) record Maybe, RecVec (ks ++ cs)) | |
=> (forall h. Foldable h => h x -> record (Maybe :. ElField) cs) | reduction step |
-> Reduce (record (Maybe :. ElField) ks) x (record (Maybe :. ElField) (ks ++ cs)) |
Reduce the data to a single row and then re-attach the key.
:: (IsoRec ks record Maybe, IsoRec cs record Maybe, IsoRec (ks ++ cs) record Maybe, RecVec (ks ++ cs)) | |
=> Fold x (record (Maybe :. ElField) cs) | reduction fold |
-> Reduce (record (Maybe :. ElField) ks) x (record (Maybe :. ElField) (ks ++ cs)) |
Reduce by folding the data to a single row and then re-attaching the key.
:: (Functor g, Foldable g, IsoRec ks record Maybe, IsoRec as record Maybe, IsoRec (ks ++ as) record Maybe, RecVec (ks ++ as)) | |
=> (y -> record (Maybe :. ElField) as) | map a result to a record |
-> Reduce (record (Maybe :. ElField) ks) x (g y) | original reduce |
-> Reduce (record (Maybe :. ElField) ks) x (g (record (Maybe :. ElField) (ks ++ as))) |
Transform a reduce which produces a container of results, with a function from each result to a record, into a reduce which produces a FrameRec of the result records with the key re-attached.
:: (Monad m, Functor g, Foldable g, IsoRec ks record Maybe, IsoRec as record Maybe, IsoRec (ks ++ as) record Maybe, RecVec (ks ++ as)) | |
=> (y -> record (Maybe :. ElField) as) | map a result to a record |
-> ReduceM m (record (Maybe :. ElField) ks) x (g y) | original reduce |
-> ReduceM m (record (Maybe :. ElField) ks) x (g (record (Maybe :. ElField) (ks ++ as))) |
Transform an effectful reduce which produces a container of results, with a function from each result to a record, into a reduce which produces a FrameRec of the result records with the key re-attached.