comma-and: Join text together with commas, and "and".

[ bsd3, library, utils ] [ Propose Tags ] [ Report a vulnerability ]

Join text together with commas, and "and".


[Skip to Readme]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.0.1, 0.2.0.0
Change log CHANGELOG.md
Dependencies base (>=4.7 && <5), data-default-class (>=0.1 && <0.2) [details]
License BSD-3-Clause
Copyright 2024 Willem Van Onsem
Author Willem Van Onsem
Maintainer hapytexeu+gh@gmail.com
Category utils
Home page https://github.com/hapytex/comma-and#readme
Source repo head: git clone https://github.com/hapytex/comma-and
Uploaded by wvanonsem90 at 2024-11-02T12:56:14Z
Distributions NixOS:0.1.0.0
Downloads 60 total (5 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2024-11-02 [all 1 reports]

Readme for comma-and-0.2.0.0

[back to package description]

comma-and

Build Status of the package by GitHub actions Build Status of the package by Hackage Hackage version badge

Joins text items together by separating these with commas, and "and" at the end.

Usage

We can combine elements with:

ghci> comma ["red", "green", "blue"]
"red, green, and blue"

The package has tooling for the two different comma styles, and can work with any string-like type.

String-like types?

The package can work with types that are an instance of IsString and Monoid. So this means it works with String, Text, ByteString, MarkupM, LaTeX, and probably a lot more types that concatenate with the Monoid instance, and are an instance of IsString.

comma-and is safe Haskell

The module is compiled with Safe and does not depend on unsafe modules.

Contribute

You can contribute by making a pull request on the GitHub repository.

You can contact the package maintainer by sending a mail to hapytexeu+gh@gmail.com.