Repository : ssh://darcs.haskell.org//srv/darcs/ghc On branch : type-nats
http://hackage.haskell.org/trac/ghc/changeset/38520502de425efe52bf061724249556f5382d0b >--------------------------------------------------------------- commit 38520502de425efe52bf061724249556f5382d0b Author: Iavor S. Diatchki <[email protected]> Date: Sat Jul 14 16:19:57 2012 -0700 Improve representation of AxiomRules. This commit also fixes the representation of axiom rules in interfaces, and the checking of axiom rules in the core lint. Now we have two shape of axiom rule: * The first is the usual one: "forall as. ps => q" * The new one provides a way to specify axiom-schemas, which are useful when defining functions on type literals. For example, to define addition on numeric literals we use a rule schema, AddDef, which behaves like this: AddDef@(1,2) :: 1 + 2 ~ 3 AddDef@(2,3) :: 2 + 3 ~ 5 etc. The schema has 2 type parameters (which have to be type literals) and asserts that the definition of type function (+) behaves like addition. compiler/basicTypes/Unique.lhs | 5 ++ compiler/coreSyn/CoreLint.lhs | 37 ++++++++---- compiler/iface/IfaceType.lhs | 4 +- compiler/iface/TcIface.lhs | 16 +++++- compiler/typecheck/TcEvidence.lhs | 9 +-- compiler/typecheck/TcTypeNats.hs | 49 ++++++++------- compiler/typecheck/TcTypeNatsRules.hs | 104 ++++++++++++++++++-------------- compiler/types/Coercion.lhs | 92 +++++++++++++++++++++-------- 8 files changed, 202 insertions(+), 114 deletions(-) Diff suppressed because of size. To see it, use: git show 38520502de425efe52bf061724249556f5382d0b _______________________________________________ Cvs-ghc mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-ghc
