@@ -7,7 +7,7 @@ module Core.Evaluate(normalise, normaliseC, normaliseAll,
7 Context, initContext, ctxtAlist, uconstraints, next_tvar,
7 Context, initContext, ctxtAlist, uconstraints, next_tvar,
8 addToCtxt, setAccess, addCtxtDef, addTyDecl, addDatatype,
8 addToCtxt, setAccess, addCtxtDef, addTyDecl, addDatatype,
9 addCasedef, addOperator,
9 addCasedef, addOperator,
10− lookupTy, lookupP, lookupDef, lookupVal, lookupTyEnv,
10+ lookupTy, lookupP, lookupDef, lookupVal, lookupTyEnv, isConName,
11 Value(..)) where
11 Value(..)) where
13import Debug.Trace
13import Debug.Trace
@@ -540,6 +540,14 @@ lookupTy root n ctxt
540 (Operator ty _ _) -> return ty
540 (Operator ty _ _) -> return ty
541 (CaseOp _ ty _ _ _) -> return ty
541 (CaseOp _ ty _ _ _) -> return ty
543+isConName :: Maybe [String] -> Name -> Context -> Bool
544+isConName root n ctxt
545+ = or $ do def <- lookupCtxt root n (definitions ctxt)
547+ (TyDecl (DCon _ _) _) -> return True
548+ (TyDecl (TCon _ _) _) -> return True
543lookupP :: Maybe [String] -> Name -> Context -> [Term]
551lookupP :: Maybe [String] -> Name -> Context -> [Term]
544lookupP root n ctxt
552lookupP root n ctxt
545 = do def <- lookupCtxt root n (definitions ctxt)
553 = do def <- lookupCtxt root n (definitions ctxt)