You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#!/usr/bin/env stack
-- stack script --resolver lts-11.0
{-# LANGUAGE ExtendedDefaultRules #-}
import Conduit
import Data.ByteString (ByteString)
myTakeCE :: Monad m => Int -> ConduitM ByteString ByteString m ()
myTakeCE n = go n
where
go 0 = return ()
go n = do
mx <- await
case mx of
Nothing -> return ()
Just x -> yield x >> go (n-1)
main :: IO ()
main = runConduitRes
$ sourceFile "input.txt"
.| myTakeCE 5
.| printC
intpu.txt の内容は以下の通り
This is a test.
The text was updated successfully, but these errors were encountered:
Conduit
クイズ 第10問 (***)以下の実行結果はどうなるでしょう!
intpu.txt
の内容は以下の通りThe text was updated successfully, but these errors were encountered: