[project @ 2001-03-20 12:37:25 by simonpj]
[ghc-hetmet.git] / ghc / compiler / prelude / TysWiredIn.lhs
index 73ef625..f67ee06 100644 (file)
@@ -111,7 +111,7 @@ import BasicTypes   ( Arity, RecFlag(..), Boxity(..), isBoxed )
 import Type            ( Type, mkTyConTy, mkTyConApp, mkTyVarTys, 
                          mkArrowKinds, liftedTypeKind, unliftedTypeKind,
                          splitTyConApp_maybe, repType,
-                         TauType, ClassContext )
+                         TauType, ThetaType )
 import Unique          ( incrUnique, mkTupleTyConUnique, mkTupleDataConUnique )
 import PrelNames
 import CmdLineOpts
@@ -197,7 +197,7 @@ mk_tc_gen_info mod tc_uniq tc_name tycon
        name1       = mkWiredInName  mod occ_name1 fn1_key
        name2       = mkWiredInName  mod occ_name2 fn2_key
 
-pcDataCon :: Name -> [TyVar] -> ClassContext -> [TauType] -> TyCon -> DataCon
+pcDataCon :: Name -> [TyVar] -> ThetaType -> [TauType] -> TyCon -> DataCon
 -- The unique is the first of two free uniques;
 -- the first is used for the datacon itself and the worker;
 -- the second is used for the wrapper.
@@ -452,19 +452,19 @@ isFFIExportResultTy :: Type -> Bool
 isFFIExportResultTy ty = checkRepTyCon legalFEResultTyCon ty
 
 isFFIDynArgumentTy :: Type -> Bool
--- The argument type of a foreign import dynamic must be either Addr, or
--- a newtype of Addr.
-isFFIDynArgumentTy = checkRepTyCon (== addrTyCon)
+-- The argument type of a foreign import dynamic must be Ptr, Addr,
+-- or a newtype of either.
+isFFIDynArgumentTy = checkRepTyCon (\tc -> tc == ptrTyCon || tc == addrTyCon)
 
 isFFIDynResultTy :: Type -> Bool
--- The result type of a foreign export dynamic must be either Addr, or
--- a newtype of Addr.
-isFFIDynResultTy = checkRepTyCon (== addrTyCon)
+-- The result type of a foreign export dynamic must be Ptr, Addr,
+-- or a newtype of either.
+isFFIDynResultTy = checkRepTyCon (\tc -> tc == ptrTyCon || tc == addrTyCon)
 
 isFFILabelTy :: Type -> Bool
--- The type of a foreign label must be either Addr, or
--- a newtype of Addr.
-isFFILabelTy = checkRepTyCon (\tc -> tc == addrTyCon || tc == ptrTyCon)
+-- The type of a foreign label must be Ptr, Addr,
+-- or a newtype of either.
+isFFILabelTy = checkRepTyCon (\tc -> tc == ptrTyCon || tc == addrTyCon)
 
 checkRepTyCon :: (TyCon -> Bool) -> Type -> Bool
        -- look through newtypes