Skip to content

Commit 0efd801

Browse files
committed
Remove Functor from stream
1 parent 9f1b7a4 commit 0efd801

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/Control/Monad/Logic/Sequence/Internal.hs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,11 @@ data StreamM m a = forall s. StreamM (s -> m (Step s a)) s
145145
stream :: Monad m => SeqT m a -> StreamM m a
146146
stream m = StreamM next m where
147147
{-# INLINE next #-}
148-
next s = step <$> toView s
149-
step Empty = Done
150-
step (h :< t) = Yield h t
148+
next s = do
149+
x <- toView s
150+
case x of
151+
Empty -> return Done
152+
h :< t -> return (Yield h t)
151153
{-# INLINE[1] stream #-}
152154

153155
unstream :: Monad m => StreamM m a -> SeqT m a

0 commit comments

Comments
 (0)