Skip to content

Data.List should have a takeLastN function

A natural compliment to the take function that instead takes n elements from the end of the list rather than from the start would be very useful.

I'm surprised it's not defined in base because it seems to be a common operation that is not trivial to define in an efficient way. See http://www.joachim-breitner.de/blog/600-On_taking_the_last_n_elements_of_a_list

Trac metadata
Trac field Value
Version 7.8.4
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component libraries/base
Test case
Differential revisions
BlockedBy
Related
Blocking
CC ekmett, hvr
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information