The first-and-last package

[Tags:bsd3, library, test]

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)
[1,2]
>>> getLast' (foldMap pure [1,2,3,4] :: Last' 2 Int)
[3,4]

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.

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 203 total (14 in the last 30 days)
Votes
0 []
Status Docs available [build log]
Last success reported on 2015-10-16 [all 1 reports]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees