apart-0.1.3: Get all your structure and rip it apart.

Safe HaskellSafe
LanguageHaskell2010

Data.Apart.Combinators

Synopsis

Documentation

type Restorer g t raw value = (Traversable t, Applicative g) => raw -> g (Segmented (Cofree t) value) Source #

Pull back segment of values to memory.

type Materializer g t raw value = (Traversable t, Applicative g) => Segmented (Cofree t) value -> g raw Source #

Put in-memory values to somewhere else.

recover :: (Traversable t, Applicative g) => Restorer g t raw value -> Scattered (Cofree t) value raw -> g (Cofree t value) Source #

Do nothing with in-memory part, pull back all values of structure to memory.

limit :: (Traversable t, Applicative g) => Int -> Materializer g t raw value -> Cofree t value -> g (Scattered (Cofree t) value raw) Source #

Keep only a certain number of elements in memory, do something with the rest.

throughout :: (Traversable t, Monad g) => (value -> g result) -> Restorer g t raw value -> Scattered (Cofree t) value raw -> g (Cofree t result) Source #

Traverse over scattered structure, including with all restored segments.

inmemory :: (Functor t, Alternative t) => Apart t raw value -> Cofree t value Source #