1-- https://github.com/snoyberg/conduit#readme
3module ConduitExample (example) where
6import System.Directory (removeFile)
9 -- Pure operations: summing numbers.
10 print $ runConduitPure $ yieldMany [1..10] .| sumC
12 -- Exception safe file access: copy a file.
13 writeFile "input.txt" "This is a test." -- create the source file
14 runConduitRes $ sourceFileBS "input.txt" .| sinkFile "output.txt" -- actual copying
15 readFile "output.txt" >>= putStrLn -- prove that it worked
17 -- Perform transformations.
18 print $ runConduitPure $ yieldMany [1..10] .| mapC (+ 1) .| sinkList
20 removeFile "input.txt"
21 removeFile "output.txt"
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list