@@ -7,7 +7,7 @@ module Core.Evaluate(normalise, normaliseC, normaliseAll,
77 Context, initContext, ctxtAlist, uconstraints, next_tvar,
88 addToCtxt, setAccess, addCtxtDef, addTyDecl, addDatatype,
99 addCasedef, addOperator,
10− lookupTy, lookupP, lookupDef, lookupVal, lookupTyEnv,
10+ lookupTy, lookupP, lookupDef, lookupVal, lookupTyEnv, isConName,
1111 Value(..)) where
1212
1313import Debug.Trace
@@ -540,6 +540,14 @@ lookupTy root n ctxt
540540 (Operator ty _ _) -> return ty
541541 (CaseOp _ ty _ _ _) -> return ty
542542
543+isConName :: Maybe [String] -> Name -> Context -> Bool
544+isConName root n ctxt
545+ = or $ do def <- lookupCtxt root n (definitions ctxt)
546+ case fst def of
547+ (TyDecl (DCon _ _) _) -> return True
548+ (TyDecl (TCon _ _) _) -> return True
549+ _ -> return False
550+
543551lookupP :: Maybe [String] -> Name -> Context -> [Term]
544552lookupP root n ctxt
545553 = do def <- lookupCtxt root n (definitions ctxt)