Presburger Arithmetic Solver for GHC Type-level natural numbers with Singletons package.

LTS Haskell 22.30:
Stackage Nightly 2024-07-24:
Latest on Hackage:

See all snapshots singletons-presburger appears in

BSD-3-Clause licensed by Hiromi ISHII
Maintained by konn.jinro _at_
This version can be pinned in stack with:singletons-presburger-,2383

Module documentation for

The singletons-presburger plugin augments GHC type-system with Presburger Arithmetic Solver for Type-level natural numbers, with integration with singletons package.

You can use by adding this package to dependencies and add the following pragma to the head of .hs files:

OPTIONS_GHC -fplugin Data.Singletons.TypeNats.Presburger



  • Supports GHC 9.10
  • Drops GHC <9.2

  • Supports GHC 9.8
  • Drops support for GHC <9

  • Supports GHC 9.6

  • Proper Support of GHC 9.4 (Now can solve Assert properly)

  • Support GHC 9.4
  • The plugin can solve constraints involving type-level Assert, Not, (&&), (||), and/or If from new base.

  • Stop discharging redundant constraints
  • Support GHC 9.0.1
  • Drop a support for GHC <8.6

  • Fixes constraint solving (fixes #9); this may change the previous (unsound) behaviour, and hence it is breaking change.

  • Supports GHC >= 8.10.

  • Initial release: separated singletons support from ghc-typelits-presburger