Copyright | (c) Adam Conner-Sax 2020 |
---|---|
License | BSD-3-Clause |
Maintainer | adam_conner_sax@yahoo.com |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
This module adds some functions for using streamly to make transformations on Frames that are either:
- Like filtering or some one-to-many mapping of rows,
whic makes the efficient memory layout useless in-flight. Frames already implements
filterFrame
this way, using Pipes and the ST monad. - Expensive enough per row that the concurrency features of streams become worthwhile.
Synopsis
- transform :: forall t as bs m. (IsStream t, PrimMonad m, RecVec as, RecVec bs) => (t m (Record as) -> SerialT m (Record bs)) -> FrameRec as -> m (FrameRec bs)
- filter :: RecVec as => (Record as -> Bool) -> FrameRec as -> FrameRec as
- concurrentMapM :: (PrimMonad m, MonadAsync m, RecVec as, RecVec bs) => (Record as -> m (Record bs)) -> FrameRec as -> m (FrameRec bs)
- mapMaybe :: (RecVec as, RecVec bs) => (Record as -> Maybe (Record bs)) -> FrameRec as -> FrameRec bs
- concurrentMapMaybeM :: (PrimMonad m, MonadAsync m, RecVec as, RecVec bs) => (Record as -> m (Maybe (Record bs))) -> FrameRec as -> m (FrameRec bs)
Documentation
transform :: forall t as bs m. (IsStream t, PrimMonad m, RecVec as, RecVec bs) => (t m (Record as) -> SerialT m (Record bs)) -> FrameRec as -> m (FrameRec bs) Source #
Use streamly to transform a frame.
filter :: RecVec as => (Record as -> Bool) -> FrameRec as -> FrameRec as Source #
Filter using streamly
concurrentMapM :: (PrimMonad m, MonadAsync m, RecVec as, RecVec bs) => (Record as -> m (Record bs)) -> FrameRec as -> m (FrameRec bs) Source #
map using speculative streams (concurrency that preserves ordering of results).