first-and-last: First and Last generalized to return up to n values

[ bsd3, data, library ] [ Propose Tags ]

This library provides data types First' n and Last' n generalizing First and Last from Data.Monoid to return up to n values.

>>> getFirst' (foldMap pure [1,2,3,4] :: First' 2 Int)
>>> getLast' (foldMap pure [1,2,3,4] :: Last' 2 Int)

It also provides API-compatible type synonyms First and Last as well as functions getFirst and getLast, allowing you to use it as a drop-in replacement.

Versions [faq],
Dependencies base (==4.8.*) [details]
License BSD-3-Clause
Copyright Copyright (C) 2015 Mark Andrus Roberts
Author Mark Andrus Roberts
Category Data
Home page
Source repo head: git clone
Uploaded by andrus at 2015-10-16T00:43:48Z
Distributions NixOS:
Downloads 1228 total (11 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2015-10-16 [all 1 reports]




Maintainer's Corner

For package maintainers and hackage trustees