Update of /cvsroot/hoc/hoc/HOC/HOC
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27903/HOC/HOC
Modified Files:
DeclareSelector.hs
Log Message:
combine foralls at top-level of type
(i.e. avoid types like "forall a. Foo a => forall b. Bar b => a -> b")
Index: DeclareSelector.hs
===================================================================
RCS file: /cvsroot/hoc/hoc/HOC/HOC/DeclareSelector.hs,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- DeclareSelector.hs 26 Jul 2005 05:25:42 -0000 1.11
+++ DeclareSelector.hs 12 Mar 2006 18:49:41 -0000 1.12
@@ -96,9 +96,17 @@
(ArrowT `AppT` arg) `AppT` replaceResult new rest
replaceResult new result = new
+ liftForalls (ForallT names cxt ty)
+ = case liftForalls ty of
+ ForallT names' cxt' ty'
+ -> ForallT (names ++ names') (cxt ++ cxt') ty'
+ ty' -> ForallT names cxt ty'
+ liftForalls other = other
+
doctorType ty className =
(
retained,
+ liftForalls $
(if needInstance
then ForallT (map mkName ["target", "inst"])
[ConT (mkName className) `AppT` VarT (mkName "target"),
|