[project @ 2003-02-06 17:37:50 by simonpj]
authorsimonpj <unknown>
Thu, 6 Feb 2003 17:37:50 +0000 (17:37 +0000)
committersimonpj <unknown>
Thu, 6 Feb 2003 17:37:50 +0000 (17:37 +0000)
Deal with TForall in cvtType

ghc/compiler/hsSyn/Convert.lhs

index 02a9406..9dbf8de 100644 (file)
@@ -21,7 +21,7 @@ import HsSyn as Hs
                Pat(..), HsConDetails(..), HsOverLit, BangType(..),
                placeHolderType, HsType(..), HsTupCon(..),
                HsTyVarBndr(..), HsContext,
-               mkSimpleMatch
+               mkSimpleMatch, mkHsForAllTy
        ) 
 
 import RdrName ( RdrName, mkRdrUnqual, mkRdrQual, mkOrig )
@@ -288,6 +288,10 @@ cvtType ty = trans (root ty [])
        trans (Tvar nm, args)       = foldl HsAppTy (HsTyVar (tName nm)) args
         trans (Tcon tc, args)       = foldl HsAppTy (HsTyVar (tc_name tc)) args
 
+       trans (TForall tvs cxt ty, []) = mkHsForAllTy (Just (cvt_tvs tvs))
+                                                     (cvt_context cxt)
+                                                     (cvtType ty)
+
        tc_name (TconName nm) = tconName nm
        tc_name Arrow         = tconName "->"
        tc_name List          = tconName "[]"