Skip to content

Commit b81997f

Browse files
committed
Fix transcribe function
1 parent 83a570a commit b81997f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/HaskellWorks/Data/Streams/Stream.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ repeat :: Int -> a -> Stream a
102102
repeat n a = Stream step n 1
103103
where step i = if i > 0 then Yield a (i - 1) else Done
104104

105-
transcribe :: (s -> a -> b) -> s -> Stream a -> Stream b
105+
transcribe :: (s -> a -> (b, s)) -> s -> Stream a -> Stream b
106106
transcribe f w (Stream step state size) = Stream step' (state, w) size
107107
where step' (t, x) = case step t of
108-
Yield a s' -> let z = f x a in Yield z (s', x)
108+
Yield a s' -> let (z, y) = f x a in Yield z (s', y)
109109
Skip s' -> Skip (s', x)
110110
Done -> Done
111111
{-# INLINE step' #-}

0 commit comments

Comments
 (0)