initialEnv :: Menv
initialEnv = efromlist [(primMname,primEnv),
- ("PrelErr",errorEnv)]
+ (errMname,errorEnv)]
primEnv :: Envs
primEnv = Envs {tcenv_=efromlist primTcs,
(tUtuple (map Tvar tvs)) tvs) tvs
where tvs = map ( \i -> ("a" ++ (show i))) [1..n]
+pv = qual primMname
+pvz = (qual primMname) . (++ "zh")
{- Addrzh -}
-
-tcAddrzh = (primMname,"Addrzh")
+tcAddrzh = pvz "Addr"
tAddrzh = Tcon tcAddrzh
ktAddrzh = Kunlifted
{- Charzh -}
-tcCharzh = (primMname,"Charzh")
+tcCharzh = pvz "Char"
tCharzh = Tcon tcCharzh
ktCharzh = Kunlifted
{- Doublezh -}
-tcDoublezh = (primMname, "Doublezh")
+tcDoublezh = pvz "Double"
tDoublezh = Tcon tcDoublezh
ktDoublezh = Kunlifted
{- Floatzh -}
-tcFloatzh = (primMname, "Floatzh")
+tcFloatzh = pvz "Float"
tFloatzh = Tcon tcFloatzh
ktFloatzh = Kunlifted
{- Intzh -}
-tcIntzh = (primMname,"Intzh")
+tcIntzh = pvz "Int"
tIntzh = Tcon tcIntzh
ktIntzh = Kunlifted
{- Int32zh -}
-tcInt32zh = (primMname,"Int32zh")
+tcInt32zh = pvz "Int32"
tInt32zh = Tcon tcInt32zh
ktInt32zh = Kunlifted
{- Int64zh -}
-tcInt64zh = (primMname,"Int64zh")
+tcInt64zh = pvz "Int64"
tInt64zh = Tcon tcInt64zh
ktInt64zh = Kunlifted
{- Wordzh -}
-tcWordzh = (primMname,"Wordzh")
+tcWordzh = pvz "Word"
tWordzh = Tcon tcWordzh
ktWordzh = Kunlifted
{- Word32zh -}
-tcWord32zh = (primMname,"Word32zh")
+tcWord32zh = pvz "Word32"
tWord32zh = Tcon tcWord32zh
ktWord32zh = Kunlifted
{- Word64zh -}
-tcWord64zh = (primMname,"Word64zh")
+tcWord64zh = pvz "Word64"
tWord64zh = Tcon tcWord64zh
ktWord64zh = Kunlifted
{- Arrays -}
-tcArrayzh = (primMname,"Arrayzh")
+tcArrayzh = pvz "Array"
tArrayzh t = Tapp (Tcon tcArrayzh) t
ktArrayzh = Karrow Klifted Kunlifted
-tcByteArrayzh = (primMname,"ByteArrayzh")
+tcByteArrayzh = pvz "ByteArray"
tByteArrayzh = Tcon tcByteArrayzh
ktByteArrayzh = Kunlifted
-tcMutableArrayzh = (primMname,"MutableArrayzh")
+tcMutableArrayzh = pvz "MutableArray"
tMutableArrayzh s t = Tapp (Tapp (Tcon tcMutableArrayzh) s) t
ktMutableArrayzh = Karrow Klifted (Karrow Klifted Kunlifted)
-tcMutableByteArrayzh = (primMname,"MutableByteArrayzh")
+tcMutableByteArrayzh = pvz "MutableByteArray"
tMutableByteArrayzh s = Tapp (Tcon tcMutableByteArrayzh) s
ktMutableByteArrayzh = Karrow Klifted Kunlifted
{- MutVars -}
-tcMutVarzh = (primMname,"MutVarzh")
+tcMutVarzh = pvz "MutVar"
tMutVarzh s t = Tapp (Tapp (Tcon tcMutVarzh) s) t
ktMutVarzh = Karrow Klifted (Karrow Klifted Kunlifted)
{- Real world and state. -}
-tcRealWorld = (primMname,"RealWorld")
+-- tjc: why isn't this one unboxed?
+tcRealWorld = pv "RealWorld"
tRealWorld = Tcon tcRealWorld
ktRealWorld = Klifted
-tcStatezh = (primMname, "Statezh")
+tcStatezh = pvz "State"
tStatezh t = Tapp (Tcon tcStatezh) t
ktStatezh = Karrow Klifted Kunlifted
{- Mvars -}
-tcMVarzh = (primMname, "MVarzh")
+tcMVarzh = pvz "MVar"
tMVarzh s t = Tapp (Tapp (Tcon tcMVarzh) s) t
ktMVarzh = Karrow Klifted (Karrow Klifted Kunlifted)
{- Weak Objects -}
-tcWeakzh = (primMname, "Weakzh")
+tcWeakzh = pvz "Weak"
tWeakzh t = Tapp (Tcon tcWeakzh) t
ktWeakzh = Karrow Klifted Kunlifted
{- Foreign Objects -}
-tcForeignObjzh = (primMname, "ForeignObjzh")
+tcForeignObjzh = pvz "ForeignObj"
tForeignObjzh = Tcon tcForeignObjzh
ktForeignObjzh = Kunlifted
{- Stable Pointers (but not names) -}
-tcStablePtrzh = (primMname, "StablePtrzh")
+tcStablePtrzh = pvz "StablePtr"
tStablePtrzh t = Tapp (Tcon tcStablePtrzh) t
ktStablePtrzh = Karrow Klifted Kunlifted
{- Concurrency operations -}
-tcThreadIdzh = (primMname,"ThreadIdzh")
+tcThreadIdzh = pvz "ThreadId"
tThreadIdzh = Tcon tcThreadIdzh
ktThreadIdzh = Kunlifted
We just define the type constructors for the dictionaries
corresponding to these pseudo-classes. -}
-tcZCTCCallable = (primMname,"ZCTCCallable")
+tcZCTCCallable = pv "ZCTCCallable"
ktZCTCCallable = Karrow Kopen Klifted -- ??
-tcZCTCReturnable = (primMname,"ZCTCReturnable")
+tcZCTCReturnable = pv "ZCTCReturnable"
ktZCTCReturnable = Karrow Kopen Klifted -- ??
{- Non-primitive, but mentioned in the types of primitives. -}
-tcUnit = ("PrelBase","Unit")
+bv = qual baseMname
+
+tcUnit = bv "Unit"
tUnit = Tcon tcUnit
ktUnit = Klifted
-tcBool = ("PrelBase","Bool")
+tcBool = bv "Bool"
tBool = Tcon tcBool
ktBool = Klifted
("irrefutPatError", Tforall ("a",Kopen) (tArrow tString (Tvar "a"))),
("patError", Tforall ("a",Kopen) (tArrow tString (Tvar "a")))]
-tcChar = ("PrelBase","Char")
+tcChar = bv "Char"
tChar = Tcon tcChar
ktChar = Klifted
-tcList = ("PrelBase","ZMZN")
+tcList = bv "ZMZN"
tList t = Tapp (Tcon tcList) t
ktList = Karrow Klifted Klifted
tString = tList tChar