first-and-last
First and Last generalized to return up to n values
This library provides data types @<Data-Monoid-First.html#t:First-39- First' n>@ and @<Data-Monoid-Last.html#t:Last-39- Last' n>@ generalizing @First@ and @Last@ from @<https://hackage.haskell.org/package/base/docs/Data-Monoid.html Data.Monoid>@ to return up to @n@ values.
>>> getFirst' (foldMap pure [1,2,3,4] :: First' 2 Int)
[1,2]
>>> getLast' (foldMap pure [1,2,3,4] :: Last' 2 Int)
[3,4]
It also provides API-compatible type synonyms @<Data-Monoid-First.html#t:First First>@ and @<Data-Monoid-Last.html#t:Last Last>@ as well as functions @<Data-Monoid-First.html#v:getFirst getFirst>@ and @<Data-Monoid-Last.html#v:getLast getLast>@, allowing you to use it as a drop-in replacement.
| version | uploaded | uploader | changes | |
|---|---|---|---|---|
| 0.1.0.1 | 2015-10-16 00:43 UTC | andrus | +19/−89 lines, 6 filesdep +doctestdep −CabalPVP ok | |
| 0.1.0.0 | 2015-10-13 18:04 UTC | andrus | +390/−0 lines, 7 filesdep +Cabaldep +basedep +first-and-lastsetup-changed |
Dependencies of first-and-last-0.1.0.1
base >=4.8 && <4.9 4.8.2.0 → 4.22.1.0 newer than bounds
| 2026-12-01 12:38 UTC | 4.22.1.0 newer than bounds | +388/−6 lines, 9 filesdep ~ghc-internalPVP: major bump suggested |
| 2025-12-19 11:52 UTC | 4.22.0.0 newer than bounds | +886/−215 lines, 28 filesdep ~ghc-internalPVP ok |
| 2026-03-27 12:26 UTC | 4.21.2.0 newer than bounds | +10/−3 lines, 4 filesdep ~ghc-internalPVP ok |
| 2025-12-27 10:31 UTC | 4.21.1.0 newer than bounds | +17/−5 lines, 4 filesdep ~ghc-internalPVP ok |
| 2024-12-16 09:24 UTC | 4.21.0.0 newer than bounds | +1170/−396 lines, 39 filesdep ~ghc-internalPVP ok |
showing 5 of 61 versions
doctest ==0.10.1 0.10.1 → 0.25.0.2 newer than bounds
| 2026-09-24 10:26 UTC | 0.25.0.2 newer than bounds | +7/−2 lines, 3 filesPVP ok |
| 2026-09-24 08:42 UTC | 0.25.0.1 newer than bounds | +36/−4 lines, 6 filesPVP ok |
| 2026-05-03 17:07 UTC | 0.25.0 newer than bounds | +55/−31 lines, 7 filesPVP ok |
| 2026-01-02 08:10 UTC | 0.24.3 newer than bounds | +25/−11 lines, 5 filesdep ~ghcPVP ok |
| 2025-06-24 14:52 UTC | 0.24.2 newer than bounds | +17/−77 lines, 10 filesdep ~basedep ~ghcPVP ok |
showing 5 of 79 versions
Reverse dependencies
1 packages depend on first-and-last