Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add monadic versions of the unfoldr functions #123

Open
hansroland opened this issue Jul 9, 2023 · 0 comments
Open

Add monadic versions of the unfoldr functions #123

hansroland opened this issue Jul 9, 2023 · 0 comments

Comments

@hansroland
Copy link

Currently vector-sized implements only pure, non-monadic version of the unfoldrfunctions, eg in the unboxed module:

  • unfoldrN :: forall n a b. (KnownNat n, Unbox a) => (b -> (a, b)) -> b -> Vector n a
  • unfoldrN' :: forall n a b p. (KnownNat n, Unbox a) => p n -> (b -> (a, b)) -> b -> Vector n a

The normal vector package has also monadic versions like unfoldrM, unfoldrNM and unfoldrExactNM.

It would be nice to have them also in this library, eg for the unboxed module:

  • unfoldrNM :: forall m n a b. (KnownNat n, Unbox a, Monad m) => (b -> m (a, b)) -> b -> m (Vector n a)
  • unfoldrNM' :: forall m n a b p. (KnownNat n, Unbox a, Monad m) => p n -> (b -> m (a, b)) -> b -> m (Vector n a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant