anonymous-sums

Anonymous sum types http://www.github.com/massysett/anonymous-sums

Version on this page:0.6.0.0
LTS Haskell 9.13:0.6.0.0
Stackage Nightly 2017-07-25:0.6.0.0
Latest on Hackage:0.6.0.0
BSD3 licensed by Omari Norman
Maintained by omari@smileystation.com

Module documentation for 0.6.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

Changes

Version 0.4.0.0

* Added Exception instances (requires major version bump)

* Added S0

* Removed Generics instances; including them makes compatibility
with GHC 7.4 more difficult. (requires major version bump)

Version 0.2.2.0

* added S1. Still debating whether and how to add S0.

Version 0.6.0.0

* Completely changed types and module names, and added Prisms
Used by 2 packages:
comments powered byDisqus