LicenseRef-PublicDomain licensed by James Cook
Maintained by Obsidian Systems, LLC
This version can be pinned in stack with:dependent-sum-,2147

Module documentation for

A dependent sum is a generalization of a particular way of thinking about the Either type. Either a b can be thought of as a 2-tuple (tag, value), where the value of the tag determines the type of the value. In particular, either tag = Left and value :: a or tag = Right and value :: b.

This package allows you to define your own dependent sum types by using your own "tag" types.


Revision history for dependent-sum - 2020-03-25

  • Shift version bounds for some to 1.0.1.* versions. - 2020-03-24

  • Fix ChangeLog to include the breaking change in and properly do major version bump to reflect the breaking change. - 2020-03-23

  • Update GitHub repository in cabal metadata. - 2020-03-21

  • (Breaking change) Removed modules Data.GADT.Compare, Data.GADT.Show, Data.Some and now re-export them from the some package. This forced some deprecations to be fully realized.
  • Update cabal meta-information (tested with GHC 8.8). - 2019-08-04

  • Revert change that increased strictness of Data.Some.Some in 0.6.1 - 2019-08-04

  • Add legacy eqTagged and compareTagged functions. Fix deprecated OrdTag synonym (it was missing the Has' Eq constraint). To upgrade from dependent-sum <0.6, you will likely need to add enable the FlexibleContexts language extension, and possible others.

0.6 - 2019-03-21

  • Use constraints-extras ArgDict/Has’ to define the instances of Eq, Ord, Read and Show for DSum. This obviates the need for the EqTag, OrdTag, ReadTag and ShowTag classes.

  • Add mkSome and mapSome to Data.Some.
  • Add GEq, GCompare, GShow, and GRead instances for Sum and Product (Except GRead (Product a b)).
  • Deprecate (:=) for (:~:) from Data.Type.Equality. In GHC 7.8 and above, this is the same as (:~:). But now we no longer support earlier GHCs, so there’s no point of the alias.
  • Remove support for GHC 7.x.
  • The git repositories for dependent-sum and dependent-sum-template are now the same, though the Haskell packages remain separate.

  • Make Some a newtype with associated pattern synonyms using unsafeCoerce to avoid the GADT performance overhead. This shouldn’t affect users.
  • Deprecate the constructor name This in favor of Some.
  • Drop support for GHC older than 8.0.