name: ghc-typelits-natnormalise
version: 0.1
synopsis: GHC typechecker plugin for types of kind GHC.TypeLits.Nat
description:
A type checker plugin for GHC that can solve /equalities/ of types of kind
'GHC.TypeLits.Nat', where these types are either:
.
* Type-level naturals
* Type variables
* Applications of the arithmetic expressions @(+,-,*,^)@.
.
It solves these equalities by normalising them to /sort-of/
'GHC.TypeLits.Normalise.SOP.SOP' (Sum-of-Products) form, and then perform a
simple syntactic equality.
.
For example, this solver can prove the equality between:
.
@
(x + 2)^(y + 2)
@
.
and
.
@
4*x*(2 + x)^y + 4*(2 + x)^y + (2 + x)^y*x^2
@
.
Because the latter is actually the 'GHC.TypeLits.Normalise.SOP.SOP' normal
form of the former.
.
To use the plugin, add the
.
@
OPTIONS_GHC -fplugin GHC.TypeLits.Normalise
@
.
Pragma to the header of your file.
homepage: http://www.clash-lang.org/
bug-reports: http://github.com/christiaanb/ghc-typelits-natnormalise/issues
license: BSD2
license-file: LICENSE
author: Christiaan Baaij
maintainer: christiaan.baaij@gmail.com
copyright: Copyright © 2015 University of Twente
category: Type System
build-type: Simple
extra-source-files: README.md
CHANGELOG.md
cabal-version: >=1.10
source-repository head
type: git
location: https://github.com/christiaanb/ghc-typelits-natnormalise.git
library
exposed-modules: GHC.TypeLits.Normalise,
GHC.TypeLits.Normalise.SOP,
GHC.TypeLits.Normalise.Unify
Other-Modules: GHC.Type.Instances
build-depends: base >=4.8 && <5,
ghc >=7.10 && <7.12
hs-source-dirs: src
default-language: Haskell2010
ghc-options: -Wall
test-suite test-ghc-tynat-normalise
type: exitcode-stdio-1.0
main-is: Tests.hs
build-depends: base >=4.8 && <4.9,
ghc-typelits-natnormalise >= 0.1,
tasty >= 0.10,
tasty-hunit >= 0.9
hs-source-dirs: tests
default-language: Haskell2010
ghc-options: -O0 -dcore-lint