anonymous-sums: Anonymous sum types

[ bsd3, data, library ] [ Propose Tags ]

Anonymous sum types. Like tuples, but for sum types rather than for product types. Or, like Either, but for more than two types.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.2.0.0, 0.2.2.0, 0.4.0.0, 0.6.0.0
Change log ChangeLog
Dependencies base (>=4.9.0.0 && <5), lens (>=4.14), template-haskell (>=2.11) [details]
License BSD-3-Clause
Author Omari Norman
Maintainer omari@smileystation.com
Category Data
Home page http://www.github.com/massysett/anonymous-sums
Source repo head: git clone https://github.com/massysett/anonymous-sums.git
Uploaded by OmariNorman at 2016-12-23T19:31:07Z
Distributions
Reverse Dependencies 3 direct, 0 indirect [details]
Downloads 3980 total (12 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2016-12-23 [all 1 reports]

Readme for anonymous-sums-0.6.0.0

[back to package description]

anonymous-sums

Provides anonymous sum types for Haskell. Kind of like Either, but for multiple types rather than just two.

This is boring and tedious but sometimes I find it handy so I shuffled it off to this library so I wouldn't have to reimplement it each time. I'm sure it could be done better with Template Haskell or Scrap Your Boilerplate or some such thing...but this works, so here it is.

The module Data.Sums is generated by another program (I generate it manually and ship that; it's not generated at compile time.) You will find the source for that in generate-sums.hs.

I generated a maximum of 15 types because the Prelude includes 15-tuples, so that seemed as good a place to stop as any. In practice I have never needed more than four types.

Github homepage:

http://www.github.com/massysett/anonymous-sums