The anonymous-sums package

[Tags: bsd3, library]

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]

Properties

Versions0.2.0.0, 0.2.2.0, 0.4.0.0
Change logChangeLog
Dependenciesbase (>=4.5.0.0 && <5) [details]
LicenseBSD3
AuthorOmari Norman
Maintaineromari@smileystation.com
CategoryData
Home pagehttp://www.github.com/massysett/anonymous-sums
Source repositoryhead: git clone https://github.com/massysett/anonymous-sums.git
Executablesgenerate-sums
UploadedMon Feb 24 01:46:04 UTC 2014 by OmariNorman
DistributionsLTSHaskell:0.4.0.0, NixOS:0.4.0.0, Stackage:0.4.0.0
Downloads633 total (35 in last 30 days)
Votes
0 []
StatusDocs available [build log]
Successful builds reported [all 1 reports]

Modules

[Index]

Flags

NameDescriptionDefaultType
build-generatorBuild binary to generate program sourceDisabledAutomatic

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainers' corner

For package maintainers and hackage trustees

Readme for anonymous-sums-0.4.0.0

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