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

Properties

Versions 0.1.0.0, 0.1.0.1
Dependencies base (==4.8.*) [details]
License BSD3
Copyright Copyright (C) 2015 Mark Andrus Roberts
Author Mark Andrus Roberts
Maintainer markandrusroberts@gmail.com
Category Data
Home page https://github.com/markandrus/first-and-last
Source repository head: git clone https://github.com/markandrus/first-and-last
Uploaded Fri Oct 16 00:43:48 UTC 2015 by andrus
Distributions NixOS:0.1.0.1
Downloads 165 total (3 in the last 30 days)
Votes
0 []
Status Docs available [build log]
Last success reported on 2015-10-16 [all 1 reports]

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees