A Machine that can read from two input stream in a deterministic manner.
Modulemachines-0.7.4Haskell2010
Data.Machine.Tee
- 3 types
- 10 values
- Packagemachines-0.7.4
- Exports13
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceTee.hs
Tees
13 declarationsA Machine that can read from two input stream in a deterministic manner with monadic side-effects.
Compose a pair of pipes onto the front of a Tee.
Examples:
import Data.Machine.Sourcerun $ tee (source [1..]) (source ['a'..'c']) zipping[(1,'a'),(2,'b'),(3,'c')]
`teeT mt ma mb` Use a Tee to interleave or combine the outputs of ma
and mb.
The resulting machine will draw from a single source.
Examples:
import Data.Machine.Sourcerun $ teeT zipping echo echo <~ source [1..5][(1,2),(3,4)]
Precompose a pipe onto the left input of a tee.
Precompose a pipe onto the right input of a tee.
Tie off one input of a tee by connecting it to a known source.
Tie off one input of a tee by connecting it to a known source.
Tie off both inputs to a tee by connecting them to known sources. This is recommended over capping each side separately, as it is far more efficient.
wait for both the left and the right sides of a T and then merge them with f.
Zip together two inputs, then apply the given function, halting as soon as either input is exhausted. This implementation reads from the left, then the right
Zip together two inputs, halting as soon as either input is exhausted.