bZ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~None*+IN6Map a stream directly to its church encoding; compare Data.List.foldrQ It permits distinctions that should be hidden, as can be seen from e.g. @isPure stream = destroy_ (const True) (const False) (const True)?and similar nonsense. The crucial constraint is that the m x -> x argument is an Eilenberg-Moore algebra@. See Atkey "Reasoning about Stream Processing with Effects",The destroy exported by the safe modules is #destroy str = destroy (observe str) reorders the arguments of  to be more akin to foldrd It is more convenient to query in ghci to figure out what kind of 'algebra' you need to write.:t destroyWith join return(Monad m, Functor f) => < (f (m a) -> m a) -> Stream f m a -> m a -- iterT#:t destroyWith (join . lift) return2(Monad m, Monad (t m), Functor f, MonadTrans t) =>= (f (t m a) -> t m a) -> Stream f m a -> t m a -- iterTM:t destroyWith effect return#(Monad m, Functor f, Functor f1) =>J (f (Stream f1 m r) -> Stream f1 m r) -> Stream f m r -> Stream f1 m r,:t destroyWith effect return (wrap . lazily) Monad m => , Stream (Of a) m r -> Stream ((,) a) m r.:t destroyWith effect return (wrap . strictly) Monad m => , Stream ((,) a) m r -> Stream (Of a) m r6:t destroyWith Data.ByteString.Streaming.effect return(Monad m, Functor f) =>M (f (ByteString m r) -> ByteString m r) -> Stream f m r -> ByteString m rQ:t destroyWith Data.ByteString.Streaming.effect return (\(a:>b) -> consChunk a b) Monad m => A Stream (Of B.ByteString) m r -> ByteString m r -- fromChunks%Reflect a church-encoded stream; cp. GHC.Exts.buildCInspect the first stage of a freely layered sequence. Compare  Pipes.next and the replica Streaming.Prelude.next. This is the uncons for the general . Hunfold inspect = id Streaming.Prelude.unfoldr StreamingPrelude.next = idBuild a StreamG by unfolding steps starting from a seed. See also the specialized  in the prelude. unfold inspect = id -- modulo the quotient we work with unfold Pipes.next :: Monad m => Producer a m r -> Stream ((,) a) m r unfold (curry (:>) . Pipes.next) :: Monad m => Producer a m r -> Stream (Of a) m r:Map layers of one functor to another with a transformationYMap layers of one functor to another with a transformation involving the base monad maps is more fundamental than mapsMY, which is best understood as a convenience for effecting this frequent composition: ,mapsM phi = decompose . maps (Compose . phi)*Resort a succession of layers of the form m (f x) . Though mapsM is best understood as: ,mapsM phi = decompose . maps (Compose . phi)we could as well define  decompose by mapsM: decompose = mapsM getCompose7Run the effects in a stream that merely layers effects.@Map each layer to an effect in the base monad, and run them all.=Interpolate a layer at each segment. This specializes to e.g. `intercalates :: (Monad m, Functor f) => Stream f m () -> Stream (Stream f m) m r -> Stream f m rSpecialized fold ;iterTM alg stream = destroy stream alg (join . lift) returnSpecialized fold 1iterT alg stream = destroy stream alg join return*Dissolves the segmentation into layers of  Stream f m layers. 9concats stream = destroy stream join (join . lift) return?S.print $ concats $ maps (cons 1776) $ chunksOf 2 (each [1..5])17761217763417765 \Split a succession of layers after some number, returning a streaming or effectful pair.+rest <- S.print $ S.splitAt 1 $ each [1..3]1 S.print rest23">Break a stream into substreams each with n functorial layers. 8S.print $ maps' sum' $ chunksOf 2 $ each [1,1,1,1,1,1,1]2221#<Make it possible to 'run' the underlying transformed monad. $:Repeat a functorial layer, command or instruction forever.&=Repeat a functorial layer, command or instruct several times.4Construct an infinite stream by cycling a finite one cycles = forever*S.print $ S.take 3 $ forever $ S.each "hi"'h''i''h'-> S.sum $ S.take 13 $ forever $ S.each [1..3]25+This is akin to the observe of Pipes.Internal1 . It reeffects the layering in instances of  Stream f m r$ so that it replicates that of FreeT. .vLift for items in the base functor. Makes a singleton or one-layer succession. It is named by similarity to lift: nlift :: (Monad m, Functor f) => m r -> Stream f m r yields :: (Monad m, Functor f) => f r -> Stream f m r1aInterleave functor layers, with the effects of the first preceding the effects of the second. #interleaves = zipsWith (liftA2 (,))Mlet paste = \a b -> interleaves (Q.lines a) (maps (Q.cons' '\t') (Q.lines b))@Q.stdout $ Q.unlines $ paste "hello\nworld\n" "goodbye\nworld\n" hello goodbye world world21Swap the order of functors in a sum of functors. `S.toListM' $ S.print $ separate $ maps S.switch $ maps (S.distinguish (=='a')) $ S.each "banana"'a''a''a' "bnn" :> ()PS.toListM' $ S.print $ separate $ maps (S.distinguish (=='a')) $ S.each "banana"'b''n''n' "aaa" :> ()3Given a stream on a sum of functors, make it a stream on the left functor, with the streaming on the other functor as the governing monad. This is useful for acting on one or the other functor with a fold.;let odd_even = S.maps (S.distinguish even) $ S.each [1..10] :t S.effects $ separate odd_evenSNow, for example, it is convenient to fold on the left and right values separately:&toListM' $ toList' (separate odd_even)#[2,4,6,8,10] :> ([1,3,5,7,9] :> ())+S.toListM' $ S.print $ separate $ odd_even13579[2,4,6,8,10] :> ()1We can easily use this device in place of filter: 4filter = S.effects . separate . maps (distinguish f)&:t hoist S.effects $ separate odd_evenFhoist S.effects $ separate odd_even :: Monad n => Stream (Of Int) n ()%S.print $ effects $ separate odd_even246810+S.print $ hoist effects $ separate odd_even135795_Group layers in an alternating stream into adjoining sub-streams of one type or another. =1 !"#$%&'()*+,-./012345' !"#$%&'()*+,-./012345'&$%,-.#345" !/012+'()*. !"#$%&'()*+,-./012345None +-./>ILNE6HA left-strict pair; the base functor for streams of individual elements.8 Note that 8, 9, :, and  are all so-called natural transformations on the primitive Of a functor If we write  % type f ~~> g = forall x . f x -> g x*then we can restate some types as follows:  mapOf :: (a -> b) -> Of a ~~> Of b -- bifunctor lmap lazily :: Of a ~~> (,) a Identity . fst' :: Of a ~~> Identity aManipulation of a  Stream f m rB by mapping often turns on recognizing natural transformations of f , thus maps is far more general the the map5 of the present module, which can be defined thus: V S.map :: (a -> b) -> Stream (Of a) m r -> Stream (Of b) m r S.map f = maps (mapOf f)This rests on recognizing that mapOf] is a natural transformation; note though that it results in such a transformation as well: ; S.map :: (a -> b) -> Stream (Of a) m ~> Stream (Of b) m <pBreak a sequence when a element falls under a predicate, keeping the rest of the stream as the return value./rest <- S.print $ S.break even $ each [1,1,2,3]11 S.print rest23= Yield elements, using a fold to maintain state, until the accumulated value satifies the supplied predicate. The fold will then be short-circuited and the element that breaks it will be included with the stream returned. This function is easiest to use with Drest <- S.print $ L.purely S.breakWhen L.sum even $ S.each [1,2,3,4]12 S.print rest34?0Apply an action to all values flowing downstreamCS.product (S.chain Prelude.print (S.each [2..4])) >>= Prelude.print234f24 :> ()@cMake a stream of traversable containers into a stream of their separate elements. This is just  concat = for str each$S.print $ S.concat (each ["xy","z"])'x''y''z'$Note that it also has the effect of  and  5S.print $ S.concat $ S.each [Just 1, Nothing, Just 2]12>S.print $ S.concat $ S.each [Right 1, Left "Error!", Right 2]12concat0 is not to be confused with the functor-general  Zconcats :: (Monad m, Functor f) => Stream (Stream f m) m r -> Stream f m r -- specializingSS.stdoutLn $ concats $ maps (<* yield "--\n--") $ chunksOf 2 $ S.show (each [1..5]) 12----34----5----A The natural cons for a  Stream (Of a).  !cons a stream = yield a >> streamUseful for interoperation: Data.Text.foldr S.cons (return ()) :: Text -> Stream (Of Char) m () Lazy.foldrChunks S.cons (return ()) :: Lazy.ByteString -> Stream (Of Strict.ByteString) m () and so on.B1Cycle repeatedly through the layers of a stream, ad inf.& This function is functor-general cycle = foreverCrest <- S.print $ S.splitAt 3 $ S.cycle (yield True >> yield False)TrueFalseTrueS.print $ S.take 3 restFalseTrueFalseC~Effect each element by the supplied number of seconds. mapM :: Monad m => (a -> m b) -> Stream (Of a) m r -> Stream (Of b) m rDcReduce a stream, performing its actions but ignoring its elements. This might just be called effects or  runEffects.&let effect = lift (putStrLn "Effect!")Blet stream = do {yield 1; effect; yield 2; effect; return (2^100)}S.effects streamEffect!Effect!1267650600228229401496703205376#S.effects $ S.takeWhile (<2) streamEffect!EWhere a transformer returns a stream, run the effects of the stream, keeping the return value. This is usually used at the type Ndrained :: Monad m => Stream (Of a) m (Stream (Of b) m r) -> Stream (Of a) m r &drained = join . fmap (lift . effects)%let take' n = S.drained . S.splitAt nBS.print $ concats $ maps (take' 1) $ S.group $ S.each "wwwwarrrrr"'w''a''r'FBIgnore the first n elements of a stream, but carry out the actionsG2Ignore elements of a stream until a test succeeds.rIO.withFile "distribute.hs" IO.ReadMode $ S.stdoutLn . S.take 2 . S.dropWhile (isPrefixOf "import") . S.fromHandle main :: IO () main = doH,Stream the elements of a foldable container.$S.print $ S.map (*100) $ each [1..3]100200300=S.print $ S.map (*100) $ each [1..3] >> lift readLn >>= yield1002003004<Enter>400IIAn infinite stream of enumerable values, starting from a given value. Streaming.Prelude.enumFrom is more desirable that  each [x..]E for the infinite case, because it has a polymorphic return type.#S.print $ S.take 3 $ S.enumFrom 'a''a''b''c'*Because their return type is polymorphic, enumFrom and  enumFromThen are useful for example with zip and zipWithE, which require the same return type in the zipped streams. With  each [1..]# the following would be impossible.Frest <- S.print $ S.zip (S.enumFrom 'a') $ S.splitAt 3 $ S.enumFrom 1('a',1)('b',2)('c',3)S.print $ S.take 3 rest456*Where a final element is specified, as in  each [1..10]E a special combinator is unneeded, since the return type would be () anyway.JAn infinite sequence of enumerable values at a fixed distance, determined by the first and second values. See the discussion of  +S.print $ S.take 3 $ S.enumFromThen 100 200100200300K/Skip elements of a stream that fail a predicateL2Skip elements of a stream that fail a monadic testMStrict fold of a  of elements MControl.Foldl.purely fold :: Monad m => Fold a b -> Stream (Of a) m () -> m bNStrict fold of a . of elements that preserves the return value. S.sum $ each [1..10]55 :> ()2(n :> rest) <- S.sum $ S.splitAt 3 (each [1..10])print n6((m :> rest') <- S.sum $ S.splitAt 3 restprint m15 S.print rest'789<The type provides for interoperation with the foldl library. SControl.Foldl.purely fold :: Monad m => Fold a b -> Stream (Of a) m r -> m (Of b r)Thus, specializing a bit: L.purely fold L.sum :: Stream (Of Int) Int r -> m (Of Int r) maps (L.purely fold L.sum) :: Stream (Stream (Of Int)) IO r -> Stream (Of Int) IO rWS.print $ mapsM (L.purely S.fold (liftA2 (,) L.list L.sum)) $ chunksOf 3 $ each [1..10] ([1,2,3],6) ([4,5,6],15) ([7,8,9],24) ([10],10)O9Strict, monadic fold of the elements of a 'Stream (Of a)' QControl.Foldl.impurely foldM :: Monad m => FoldM a b -> Stream (Of a) m () -> m bP9Strict, monadic fold of the elements of a 'Stream (Of a)' VControl.Foldl.impurely foldM' :: Monad m => FoldM a b -> Stream (Of a) m r -> m (b, r)QXA natural right fold for consuming a stream of elements. See also the more general  in the  Streaming( module and the still more general  foldrT (\a p -> Pipes.yield a >> p) :: Monad m => Stream (Of a) m r -> Producer a m r foldrT (\a p -> Conduit.yield a >> p) :: Monad m => Stream (Of a) m r -> Conduit a m rRWA natural right fold for consuming a stream of elements. See also the more general  in the  Streaming' module and the still more general Sforv replaces each element of a stream with an associated stream. Note that the associated stream may layer any functor. TGGroup layers of any functor by comparisons on a preliminary annotation UFGroup elements of a stream by comparisons on a preliminary annotation WHIterate a pure function from a seed value, streaming the results foreverKIterate a monadic function from a seed value, streaming the results foreverX*Run a stream, remembering only its length:S.length $ S.each [1..10]10Y7Run a stream, keeping its length and its return value. 6S.print $ mapsM S.length $ chunksOf 3 $ S.each [1..10]3331Z)Standard map on the elements of a stream.[[For each element of a stream, stream a foldable container of elements instead; compare  . .mapFoldable f str = for str (\a -> each (f a))'S.print $ S.mapFoldable show $ yield 12'1''2'\DReplace each element of a stream with the result of a monadic action]:Reduce a stream to its return value with a monadic action.0mapM_ Prelude.print $ each [1..3] >> return True123True`rThe standard way of inspecting the first item in a stream of elements, if the stream is still 'running'. The Right< case contains a Haskell pair, where the more general inspectE would return a left-strict pair. There is no reason to prefer inspect since, if the RightW case is exposed, the first element in the pair will have been evaluated to whnf. next :: Monad m => Stream (Of a) m r -> m (Either r (a, Stream (Of a) m r)) inspect :: Monad m => Stream (Of a) m r -> m (Either r (Of a (Stream (Of a) m r)))Interoperate with pipes producers thus: Pipes.unfoldr Stream.next :: Stream (Of a) m r -> Producer a m r Stream.unfoldr Pipes.next :: Producer a m r -> Stream (Of a) m r  Similarly:  IOStreams.unfoldM (liftM (either (const Nothing) Just) . next) :: Stream (Of a) IO b -> IO (InputStream a) Conduit.unfoldM (liftM (either (const Nothing) Just) . next) :: Stream (Of a) m r -> Source a m rBut see a", which is better fitted to these unfoldMsaMInspect the first item in a stream of elements, without a return value. uncons6 provides convenient exit into another streaming type: IOStreams.unfoldM uncons :: Stream (Of a) IO b -> IO (InputStream a) Conduit.unfoldM uncons :: Stream (Of a) m r -> Conduit.Source m abFold a  of numbers into their productcFold a 4 of numbers into their product with the return value F maps' product' :: Stream (Stream (Of Int)) m r -> Stream (Of Int) m rdKMake a stream of strings into a stream of parsed values, skipping bad caseseRepeat an element ad inf. .S.print $ S.take 3 $ S.repeat 1111fRepeat a monadic action ad inf., streaming its results.&S.toListM $ S.take 2 (repeatM getLine) hello<Enter> world<Enter>["hello","world"]gRepeat an element several timesh6Repeat an action several times, streaming the results.'S.print $ S.replicateM 2 getCurrentTime2015-08-18 00:57:36.124508 UTC2015-08-18 00:57:36.124785 UTCiRead an IORef (Maybe a)$ or a similar device until it reads Nothing. reread# provides convenient exit from the  io-streams library reread readIORef :: IORef (Maybe a) -> Stream (Of a) IO () reread Streams.read :: System.IO.Streams.InputStream a -> Stream (Of a) IO ()j=Strict left scan, streaming, e.g. successive partial results. ZControl.Foldl.purely scan :: Monad m => Fold a b -> Stream (Of a) m r -> Stream (Of b) m r.S.print $ L.purely S.scan L.list $ each [3..5][][3][3,4][3,4,5]LA simple way of including the scanned item with the accumulator is to use  . See also llet a >< b = (,) <$> a <*> b;S.print $ L.purely S.scan (L.last >< L.sum) $ S.each [1..3] (Nothing,0) (Just 1,1) (Just 2,3) (Just 3,6)kStrict, monadic left scan `Control.Foldl.impurely scanM :: Monad m => FoldM a m b -> Stream (Of a) m r -> Stream (Of b) m rYlet v = L.impurely scanM L.vector $ each [1..4::Int] :: Stream (Of (U.Vector Int)) IO () S.print v fromList [] fromList [1]fromList [1,2]fromList [1,2,3]fromList [1,2,3,4]m Like the 8 but streaming. The result type is a stream of a's, but is not accumulatedj; the effects of the elements of the original stream are interleaved in the resulting stream. Compare: wsequence :: Monad m => [m a] -> m [a] sequence :: Monad m => Stream (Of (m a)) m r -> Stream (Of a) m roFold a  of numbers into their sumpFold a 0 of numbers into their sum with the return value B maps' sum' :: Stream (Stream (Of Int)) m r -> Stream (Of Int) m rq?Stream elements until one fails the condition, return the rest.r[Split a stream of elements wherever a given element arises. The action is like that of . 7S.stdoutLn $ mapsM S.toList $ split ' ' "hello world "helloworld>Prelude.mapM_ Prelude.putStrLn (Prelude.words "hello world ")helloworldsSplit a succession of layers after some number, returning a streaming or -- effectful pair. This function is the same as the   exported by the --  Streamingk module, but since this module is imported qualified, it can -- usurp a Prelude name. It specializes to: c splitAt :: (Monad m, Functor f) => Int -> Stream (Of a) m r -> Stream (Of a) m (Stream (Of a) m r)tKEnd a stream after n elements; the original return value is thus lost. s- preserves this information. Note that, like splitAtF, this function is functor-general, so that, for example, you can takeh not just a number of items from a stream of elements, but a number of substreams and the like.:S.print $ mapsM S.sum $ S.take 2 $ chunksOf 3 $ each [1..]6 -- sum of first group of 315 -- sum of second group of 3uQEnd stream when an element fails a condition; the original return value is lost q preserves this information.w4Convert an effectful 'Stream (Of a)' into a list of as^Note: Needless to say this function does not stream properly. It is basically the same as \ which, like h, mX and similar operations on traversable containers is a leading cause of space leaks.xConvert an effectful ' into a list alongside the return value B mapsM toListM :: Stream (Stream (Of a)) m r -> Stream (Of [a]) m yBuild a Stream* by unfolding steps starting from a seed. RThe seed can of course be anything, but this is one natural way to consume a pipes  . Consider:2S.stdoutLn $ S.take 2 (S.unfoldr P.next P.stdinLn) hello<Enter>hellogoodbye<Enter>goodbye8S.stdoutLn $ S.unfoldr P.next (P.stdinLn P.>-> P.take 2) hello<Enter>hellogoodbye<Enter>goodbyeHS.effects $ S.unfoldr P.next (P.stdinLn P.>-> P.take 2 P.>-> P.stdoutLn) hello<Enter>hellogoodbye<Enter>goodbyefIf the intended "coalgebra" is complicated it might be pleasant to write it with the state monad: ~\state seed -> S.unfoldr (runExceptT . runStateT state) seed :: Monad m => StateT s (ExceptT r m) a -> s -> P.Producer a m ralet state = do {n <- get ; if n >= 3 then lift (throwE "Got to three"); else put (n+1); return n}5S.print $ S.unfoldr (runExceptT . runStateT state) 0012"Got to three"zA singleton streamstdoutLn $ yield "hello"helloS.sum $ do {yield 1; yield 2}3kS.sum $ do {yield 1; lift $ putStrLn "/* 1 was yielded */"; yield 2; lift $ putStrLn "/* 2 was yielded */"}/* 1 was yielded *//* 2 was yielded */3Clet prompt :: IO Int; prompt = putStrLn "Enter a number:" >> readLnRS.sum $ do {lift prompt >>= yield ; lift prompt >>= yield ; lift prompt >>= yield}Enter a number:3<Enter>Enter a number: 20<Enter>Enter a number: 100<Enter>123{Zip two Streamss |Zip two Streams's using the provided combining function} Zip three s with a combining function~Zip three streams together repeatedly stream lines as  from stdin!stdoutLn $ S.show (S.each [1..3])123stdoutLn stdinLn hello<Enter>hello world<Enter>world^CInterrupted. stdoutLn $ S.map reverse stdinLn hello<Enter>olleh world<Enter>dlrow^CInterrupted.Read values from , ignoring failed parses#S.sum $ S.take 2 S.readLn :: IO Int3<Enter>#$%^&\^?<Enter> 1000<Enter>1003Read  s from a  using Terminates on end of inputDwithFile "distribute.hs" ReadMode $ stdoutLn . S.take 3 . fromHandleimport Streaming'import qualified Streaming.Prelude as S'import Control.Monad.Trans.State.Strict-Print the elements of a stream as they arise.Write s to  using 2; terminates on a broken output pipe (compare  ).#S.stdoutLn $ S.show (S.each [1..3])123Write s to  using mThis does not handle a broken output pipe, but has a polymorphic return value, which makes this possible:6rest <- stdoutLn' $ S.show $ S.splitAt 3 (each [1..5])123 S.sum rest9d6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Z2346789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Z67zHyWegBfhIJ]DEZ\?m[KLSCtuFG@jkldnA`asr><=qVUTv234NMPOpocbYXxw^_RQ{|~}89:;ia6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~7NoneIN2  !"#$%&,-./013456789S2S.&$%,-#3450/1 !"6789   !"#!"$!%&!%'!()!(*!(*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcd efghijklmnopqrstu vwxyz{|}~strea_6ta7KmFw8rVECfiNq6bTov StreamingStreaming.InternalStreaming.Preludeunfoldr Control.Foldlpurely Data.Maybe catMaybes Data.EitherrightsenumFrom Pipes.Prelude mapFoldablelast Data.ListsequencePipesProducerstdoutLnbaseGHC.Basejoin Data.FunctorvoidliftA3liftA2mmorp_8dNpUU8QFPe77rrwKAb20bControl.Monad.MorphhoistMFunctorembedMMonadtrans_3eG64VdP2vzGjP6wJiCp5XControl.Monad.Trans.Class MonadTransliftControl.Monad.IO.ClassMonadIOliftIOData.Functor.Compose getComposeComposeStreamStepEffectReturndestroy constructinspectunfoldmapsmapsM decomposerunmapsM_ intercalatesiterTMiterTconcatssplitsAttakeschunksOf distributerepeatsrepeatsM replicates hoistExposed mapsExposed mapsMExposeddestroyExposed unexposedmwrapwrapyieldszipsWithzips interleavesswitchseparate unseparategroupsOf:>lazilystrictlyfst'snd'break breakWhenbreakschainconcatconscycledelayeffectsdraineddrop dropWhileeach enumFromThenfilterfilterMfold_foldfoldM_foldMfoldrTfoldrMfor groupedBygroupBygroupiteratelength_lengthmapmapMmapM_mconcatmconcat_nextunconsproduct_productreadrepeatrepeatM replicate replicateMrereadscanscanMscannedshowsum_sumspansplitsplitAttake takeWhiletimedtoList_toListyieldzipzipWithzipWith3zip3stdinLnreadLn fromHandletoHandleprint stdoutLn' distinguish eitherToSum composeToSum sumToCompose duplicate destroyWithcycles_bind$fMonadIOStream$fMMonadStream$fMFunctorStream$fMonadTransStream$fApplicativeStream $fMonadStream$fFunctorStreammapOfiterateM Data.OldListwordsStringGHC.IO.Handle.FDstdinGHC.IO.Handle.TypesHandleGHC.IO.Handle.TexthGetLinestdout System.IOputStrLnMaybe'Just'Nothing'loop $fShow1Of $fRead1Of$fOrd1Of$fEq1Of$fIsStringStream $fMonadOf$fApplicativeOf $fFunctorOf $fMonoidOf