[GHC] #10084: Data.List should have a takeLastN function
GHC
ghc-devs at haskell.org
Thu Feb 12 14:49:58 UTC 2015
#10084: Data.List should have a takeLastN function
-------------------------------------+-------------------------------------
Reporter: leonbaum2 | Owner:
Type: feature request | Status: new
Priority: normal | Milestone:
Component: libraries/base | Version: 7.8.4
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: None/Unknown | Unknown/Multiple
Blocked By: | Test Case:
Related Tickets: | Blocking:
| Differential Revisions:
-------------------------------------+-------------------------------------
Comment (by nomeata):
Heh, nice to see my blog cited here :-)
One could argue that obviously, when you do `takeLastN` on a list, you are
using the wrong data structure. But we also have `last` and `isSuffixOf`
in `Data.List`, and maybe leaving it out for that reason is too much
patronizing...
In general, I’m in favor of adding that function.
Did you have a real, practical need for the function, or are you bringing
this up for other reasons?
If you want this to become real, I suggest you follow the process in
https://wiki.haskell.org/Library_submissions, i.e. send your proposal to
the libraries mailing list.
Possible issues to consider in the proposal and following discussion:
* What is a good name for this?
* If we have `takeLastN`, do we need `dropLastN`? How would that be
implemented?
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10084#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list