The first-and-last package

[Tags:bsd3, library, test]

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 @< 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.


Dependencies base (==4.8.*) [details]
License BSD3
Copyright Copyright (C) 2015 Mark Andrus Roberts
Author Mark Andrus Roberts
Category Data
Home page
Source repository head: git clone
Uploaded Fri Oct 16 00:43:48 UTC 2015 by andrus
Distributions NixOS:
Downloads 181 total (6 in the last 30 days)
0 []
Status Docs available [build log]
Last success reported on 2015-10-16 [all 1 reports]
Hackage Matrix CI




Maintainer's Corner

For package maintainers and hackage trustees