mirror of
https://github.com/simplex-chat/haskell.nix.git
synced 2026-06-03 09:17:32 +00:00
48b8674f5f
- Added the ability to generate coverage reports for packages and projects. - Outputs mix and tix information, as well as a HTML report. - Added the "doCoverage" module option that allows users to choose packages to enable coverage for. - Added a "doCoverage" flag to the component builder that outputs HPC information when coverage is enabled. - Added the "overrideModules" library function to make it more ergonomic fo users to enable coverage on existing projects. - Modified the "check" builder to also output ".tix" files (if they exist). This information is required to generate the coverage report. - Added a test for coverage.
20 lines
638 B
Haskell
20 lines
638 B
Haskell
-- https://github.com/snoyberg/conduit#readme
|
|
|
|
import Conduit
|
|
import System.Directory (removeFile)
|
|
|
|
main = do
|
|
-- Pure operations: summing numbers.
|
|
print $ runConduitPure $ yieldMany [1..10] .| sumC
|
|
|
|
-- Exception safe file access: copy a file.
|
|
writeFile "input.txt" "This is a test." -- create the source file
|
|
runConduitRes $ sourceFileBS "input.txt" .| sinkFile "output.txt" -- actual copying
|
|
readFile "output.txt" >>= putStrLn -- prove that it worked
|
|
|
|
-- Perform transformations.
|
|
print $ runConduitPure $ yieldMany [1..10] .| mapC (+ 1) .| sinkList
|
|
|
|
removeFile "input.txt"
|
|
removeFile "output.txt"
|