Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Last active July 28, 2017 17:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deque-blog/47c09db4e7c26b9714f595ac55ccae99 to your computer and use it in GitHub Desktop.
Save deque-blog/47c09db4e7c26b9714f595ac55ccae99 to your computer and use it in GitHub Desktop.
indexingFrom : Int -> Transducer acc s (Int, s) a (Int, a)
indexingFrom startIndex = statefulTransducer startIndex stepImpl
where
stepImpl next (n, acc) a = withState (succ n) <$> next acc (n, a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment