Skip to content

Enable retrieval of element in array/slice which is neither head nor tail.#163

Open
dihedron wants to merge 1 commit intothoas:mainfrom
dihedron:main
Open

Enable retrieval of element in array/slice which is neither head nor tail.#163
dihedron wants to merge 1 commit intothoas:mainfrom
dihedron:main

Conversation

@dihedron
Copy link
Copy Markdown

@dihedron dihedron commented May 3, 2023

It would be nice if the library provided a way to get an arbitrary element (given its index) out of an array/slice.
the funk.Head() and funk.Last() already provide almost all that is needed in order to get elements at index 0 and len(slice)-1.
I have added the trivial implementation of a funk.ElementAt(<slice>, index) function and its associated unit test.

@dihedron
Copy link
Copy Markdown
Author

dihedron commented May 3, 2023

I don't see why the checks fail, especially the Go lint one.

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

Successfully merging this pull request may close these issues.

1 participant