Make utils/genprimopcode recognise the type ().
It was previously written 'Unit', which is easily
confused with the type 'Unit' (used for generic
derived instances).
-----------------------------------------------------------------------
-----------------------------------------------------------------------
--- $Id: primops.txt.pp,v 1.23 2002/12/11 15:36:35 simonmar Exp $
+-- $Id: primops.txt.pp,v 1.24 2003/02/04 12:40:00 simonpj Exp $
--
-- Primitive Operations
--
--
-- Primitive Operations
--
primop FinalizeWeakOp "finalizeWeak#" GenPrimOp
Weak# a -> State# RealWorld -> (# State# RealWorld, Int#,
primop FinalizeWeakOp "finalizeWeak#" GenPrimOp
Weak# a -> State# RealWorld -> (# State# RealWorld, Int#,
- (State# RealWorld -> (# State# RealWorld, Unit #)) #)
+ (State# RealWorld -> (# State# RealWorld, () #)) #)
with
usage = { mangle FinalizeWeakOp [mkM, mkP]
(mkR . (inUB FinalizeWeakOp
with
usage = { mangle FinalizeWeakOp [mkM, mkP]
(mkR . (inUB FinalizeWeakOp
ppType (TyApp "ThreadId#" []) = "threadIdPrimTy"
ppType (TyApp "ForeignObj#" []) = "foreignObjPrimTy"
ppType (TyApp "BCO#" []) = "bcoPrimTy"
ppType (TyApp "ThreadId#" []) = "threadIdPrimTy"
ppType (TyApp "ForeignObj#" []) = "foreignObjPrimTy"
ppType (TyApp "BCO#" []) = "bcoPrimTy"
-ppType (TyApp "Unit" []) = "unitTy" -- dodgy
+ppType (TyApp "()" []) = "unitTy" -- unitTy is TysWiredIn's name for ()
ppType (TyVar "a") = "alphaTy"
ppType (TyVar "a") = "alphaTy"
]
pTyvar = sat (`notElem` ["section","primop","with"]) pName
]
pTyvar = sat (`notElem` ["section","primop","with"]) pName
+pTycon = alts [pConstructor, lexeme (string "()")]
pName = lexeme (then2 (:) lower (many isIdChar))
pConstructor = lexeme (then2 (:) upper (many isIdChar))
pName = lexeme (then2 (:) lower (many isIdChar))
pConstructor = lexeme (then2 (:) upper (many isIdChar))