Tidy up coercions, and implement csel1, csel2, cselR
authorsimonpj@microsoft.com <unknown>
Fri, 6 Nov 2009 17:38:01 +0000 (17:38 +0000)
committersimonpj@microsoft.com <unknown>
Fri, 6 Nov 2009 17:38:01 +0000 (17:38 +0000)
commitbcadca676448e38427b910bad5d7063f948a99c8
treebc3851e34ded7613d50f0331df00e73d2d9d0c3f
parentd7bc4e06c0b16d242f1f26100f4146f40f5de5a8
Tidy up coercions, and implement csel1, csel2, cselR

In preparation for implementing the PushC rule for coercion-swizzling
in the Simplifier, I had to inmplement the three new decomposition
operators for coercions, which I've called csel1, csel2, and cselR.

     co :: ((s1~t1) => r1) ~ ((s2~t2) => r2)
     ---------------------------------------
              csel1 co :: s1~s2

and similarly csel2, cselR.

On the way I fixed the coercionKind function for types of form
          (s1~t2) => r2
which currently are expressed as a forall type.

And I refactored quite a bit to help myself understand what is
going on.
compiler/coreSyn/CoreLint.lhs
compiler/coreSyn/CoreUtils.lhs
compiler/coreSyn/PprCore.lhs
compiler/prelude/PrelNames.lhs
compiler/types/Coercion.lhs
compiler/types/Type.lhs
compiler/types/TypeRep.lhs
compiler/types/Unify.lhs