on master help sign in
update tutorial to use repeatM instead of cycle1
commit33ae318bb63e5d5213ae5ebd51e3d90af79d3a9d authorHarendra Kumar <harendra.kumar@gmail.com> dateThu 3 May 2018, 04:48 (8 years ago) parent74a8969
1 file changed+3−3
src/Streamly/Tutorial.hs+3−3
src/Streamly/Tutorial.hs+3−3
@@ -236,7 +236,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
236236-- forever:
237237--
238238-- @
239−-- > runStream $ cycle1 (S.once getLine) & S.mapM putStrLn
239+-- > runStream $ S.repeatM getLine & S.mapM putStrLn
240240-- @
241241--
242242-- The following code snippet reads lines from standard input, filters blank
@@ -248,9 +248,9 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
248248-- import qualified Streamly.Prelude as S
249249-- import Data.Char (toUpper)
250250-- import Data.Function ((&))
251−-- import Data.Semigroup (cycle1)
252251--
253−-- main = runStream $ cycle1 (S.once getLine)
252+-- main = runStream $
253+-- S.repeatM getLine
254254-- & S.filter (not . null)
255255-- & S.drop 1
256256-- & S.take 2