Skip to content

Add monadic versions of the unfoldr functions #123

Description

@hansroland

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions