fix some warnings

This commit is contained in:
Filip Gralinski 2018-08-17 17:52:41 +02:00
parent 8b7a18b4c7
commit c79c4b356e

View File

@ -403,7 +403,7 @@ getInputSourceIfNeeded forced metrics directory inputFilePath
fileAsLineSource :: SourceSpec -> (Text -> Text) -> LineSource (ResourceT IO) fileAsLineSource :: SourceSpec -> (Text -> Text) -> LineSource (ResourceT IO)
fileAsLineSource spec preprocess = fileAsLineSource spec preprocess =
LineSource ((smartSource spec) $= autoDecompress $= CT.decodeUtf8Lenient =$= CT.lines) preprocess spec 1 LineSource ((smartSource spec) .| autoDecompress $= CT.decodeUtf8Lenient =$= CT.lines) preprocess spec 1
gevalCoreOnSingleLines :: Metric -> (Text -> Text) -> LineInFile -> LineInFile -> LineInFile -> IO (MetricValue) gevalCoreOnSingleLines :: Metric -> (Text -> Text) -> LineInFile -> LineInFile -> LineInFile -> IO (MetricValue)
gevalCoreOnSingleLines metric preprocess inpLine expLine outLine = gevalCoreOnSingleLines metric preprocess inpLine expLine outLine =
@ -673,7 +673,7 @@ gevalCoreGeneralized' parserSpec itemStep aggregator finalStep context = do
v <- runResourceT $ v <- runResourceT $
(((getZipSource $ (,) (((getZipSource $ (,)
<$> ZipSource (CL.sourceList [(getFirstLineNo (Proxy :: Proxy m) context)..]) <$> ZipSource (CL.sourceList [(getFirstLineNo (Proxy :: Proxy m) context)..])
<*> (ZipSource $ recordSource context parserSpec)) .| CL.map (checkStep (Proxy :: Proxy m) itemStep)) $$ CL.catMaybes =$ aggregator) <*> (ZipSource $ recordSource context parserSpec)) .| CL.map (checkStep (Proxy :: Proxy m) itemStep)) $$ CL.catMaybes .| aggregator)
return $ finalStep v return $ finalStep v
-- | A type family to handle all the evaluation "context". -- | A type family to handle all the evaluation "context".
@ -765,7 +765,7 @@ averageC = getZipSink
items :: MonadResource m => LineSource m -> (Text -> Either String a) -> ConduitT () (SourceItem a) m () items :: MonadResource m => LineSource m -> (Text -> Either String a) -> ConduitT () (SourceItem a) m ()
items (LineSource lineSource preprocess _ _) parser = items (LineSource lineSource preprocess _ _) parser =
(lineSource =$= CL.map (toItem . parser . preprocess)) >> yield Done (lineSource .| CL.map (toItem . parser . preprocess)) >> yield Done
where toItem (Right x) = Got x where toItem (Right x) = Got x
toItem (Left m) = Wrong m toItem (Left m) = Wrong m