on master help sign in
add singleton stream case
commit6c5da1c5000fef2d57ab694dd961d82affaa39cc authorHarendra Kumar <harendra.kumar@gmail.com> dateSun 15 Apr 2018, 11:45 (9 years ago) parent0b51df3
1 file changed+5−1
test/Prop.hs+5−1
test/Prop.hs+5−1
@@ -310,7 +310,11 @@ main = hspec $ do
310310 `shouldReturn` (take 100 $ iterate (+ 1) 0)
311311
312312 let folded :: Streaming t => [a] -> t IO a
313− folded = adapt . serially . (foldMapWith (<>) return)
313+ folded = adapt . serially . (\xs ->
314+ case xs of
315+ [x] -> return x -- singleton stream case
316+ _ -> foldMapWith (<>) return xs
317+ )
314318 describe "Functor operations" $ do
315319 functorOps A.each "serially" serially (==)
316320 functorOps folded "serially folded" serially (==)