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 Data.List.NonEmpty.deleteAt #168

Open
jamesdbrock opened this issue Apr 7, 2020 · 4 comments
Open

Add Data.List.NonEmpty.deleteAt #168

jamesdbrock opened this issue Apr 7, 2020 · 4 comments
Labels
type: enhancement A new feature or addition.

Comments

@jamesdbrock
Copy link

https://pursuit.purescript.org/packages/purescript-lists/5.4.1/docs/Data.List.NonEmpty

Data.List.NonEmpty.deleteAt function doesn't exist, but

do exist. Seems like we should add Data.List.NonEmpty.deleteAt ?

@jamesdbrock
Copy link
Author

deleteAt :: forall a. Int -> NonEmptyList a -> Maybe (List a)

@jamesdbrock
Copy link
Author

deleteAt :: forall a. Int -> NonEmptyList a -> Maybe (List a)
deleteAt i (NonEmptyList (x :| xs))
  | i == 0 = Just xs
  | otherwise = L.Cons x <$> L.deleteAt (i - 1) xs

@jamesdbrock
Copy link
Author

Also alterAt?

@garyb
Copy link
Member

garyb commented Apr 8, 2020

Adding these sounds good to me!

@JordanMartinez JordanMartinez added the type: enhancement A new feature or addition. label Dec 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A new feature or addition.
Projects
None yet
Development

No branches or pull requests

3 participants