First and Last generalized to return up to n values https://github.com/markandrus/first-and-last
|Latest on Hackage:||0.1.0.1|
This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.
getFirst' (foldMap pure [1,2,3,4] :: First' 2 Int)
getLast' (foldMap pure [1,2,3,4] :: Last' 2 Int)