first-and-last-0.1.0.0: first-and-last.cabal
name: first-and-last
version: 0.1.0.0
synopsis: First and Last generalized to return up to n values
description:
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.
homepage: https://github.com/markandrus/first-and-last
license: BSD3
license-file: LICENSE
author: Mark Andrus Roberts
maintainer: markandrusroberts@gmail.com
copyright: Copyright (C) 2015 Mark Andrus Roberts
category: Data
build-type: Simple
cabal-version: >=1.10
source-repository head
type: git
location: https://github.com/markandrus/first-and-last
library
exposed-modules: Data.Monoid.First,
Data.Monoid.Last
build-depends: base >=4.8 && <4.9
hs-source-dirs: src
default-language: Haskell2010
ghc-options: -Wall
test-suite Golden
type: detailed-0.9
test-module: Golden
build-depends: base >=4.8 && <4.9,
Cabal >=1.22.4,
first-and-last
hs-source-dirs: test
default-language: Haskell2010
ghc-options: -Wall