Skip to content

Instantly share code, notes, and snippets.

@naoto-ogawa
Created May 4, 2019 04:56
Show Gist options
  • Save naoto-ogawa/5a592480fa2e7a197e500458169c0f75 to your computer and use it in GitHub Desktop.
Save naoto-ogawa/5a592480fa2e7a197e500458169c0f75 to your computer and use it in GitHub Desktop.
io-stream sample 3 (copy)
module SampleStream where
import Prelude as P hiding(lines)
import qualified Data.ByteString.UTF8 as BU
import System.IO.Streams
import System.IO.Streams.Debug
copy :: IO ()
copy = withFileAsOutput "./test/data/Types.hs.out1" (\os -> do
withFileAsInput "./test/data/Types.hs" (\is -> do
-- is1 <- lines is
-- is2 <- debugInputBS (BU.fromString "test") stdout is1
-- connect is2 os
connect is os
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment