Frames-streamly-0.1.0.2: A streamly layer for Frames I/O
Copyright(c) Adam Conner-Sax 2020
LicenseBSD-3-Clause
Maintaineradam_conner_sax@yahoo.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Frames.Streamly.Transform

Description

This module adds some functions for using streamly to make transformations on Frames that are either:

  1. 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.
  2. Expensive enough per row that the concurrency features of streams become worthwhile.
Synopsis

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).

mapMaybe :: (RecVec as, RecVec bs) => (Record as -> Maybe (Record bs)) -> FrameRec as -> FrameRec bs Source #

mapMaybe using streamly

concurrentMapMaybeM :: (PrimMonad m, MonadAsync m, RecVec as, RecVec bs) => (Record as -> m (Maybe (Record bs))) -> FrameRec as -> m (FrameRec bs) Source #

mapMaybeM using speculative streams (concurrency that preserves ordering of results).