Fix handling p<P> with line-by-line mode
This commit is contained in:
parent
40bf850423
commit
2783a5bed8
@ -7,10 +7,15 @@ import Data.Text.Read as TR
|
||||
import Data.Word
|
||||
import Control.Exception
|
||||
|
||||
import Data.Attoparsec.Text
|
||||
import Data.Attoparsec.Text hiding (Done)
|
||||
|
||||
data SourceItem a = Got a | Wrong String | Done
|
||||
|
||||
instance Functor SourceItem where
|
||||
fmap f (Got a) = Got (f a)
|
||||
fmap _ (Wrong s) = Wrong s
|
||||
fmap _ Done = Done
|
||||
|
||||
type MetricValue = Double
|
||||
|
||||
data GraphSeries = GraphSeries [(Double, Double)]
|
||||
|
@ -1163,8 +1163,11 @@ threeLineSource (WithInput theFilter inputLineSource expectedLineSource outLineS
|
||||
<*> (ZipSource $ getZipSource $ (,)
|
||||
<$> ZipSource (linesAsItems expectedLineSource)
|
||||
<*> ZipSource (linesAsItems outLineSource)))
|
||||
.| (CC.filter (applyFilterToSourceItems $ generalizedFilterFilter theFilter))
|
||||
.| (CC.map (\(x, (y,z)) -> WrappedParsedRecordWithInput x y z))
|
||||
.| (CC.map (\(x, (y,z)) -> TargetRecord (fmap RawItemTarget x) (fmap RawItemTarget y) (fmap RawItemTarget z)))
|
||||
.| (CC.filter (applyFilter $ generalizedFilterFilter theFilter))
|
||||
.| topperConduit (generalizedFilterTopper theFilter)
|
||||
.| (CC.map (\(TargetRecord x y z) -> WrappedParsedRecordWithInput (unwrap x) (unwrap y) (unwrap z)))
|
||||
where unwrap = fmap (\(RawItemTarget x) -> x)
|
||||
|
||||
averageC :: MonadResource m => ConduitT Double Void m Double
|
||||
averageC = getZipSink
|
||||
|
Loading…
Reference in New Issue
Block a user