Skip to content

Getting some results #38

@treeowl

Description

@treeowl

When you want more than one result, but not all of them, things can be a tad awkward. First off, there's no native function to do that! An obvious one might be

splitUpTo :: Int -> SeqT m a -> m ([a], m a)

to get up to n results in a list. Another might get fancier with length-indexed vectors

data Vec n a where
  Nil :: Vec Z a
  Cons :: a -> Vec n a -> Vec (S n) a

splitExact :: SNat n -> SeqT m a -> m (Maybe (Vec n a, m a))

Stuff like that.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions