@@ -8,7 +8,7 @@ module Core.Evaluate(normalise, normaliseC, normaliseAll,
8 addToCtxt, setAccess, setTotal, addCtxtDef, addTyDecl, addDatatype,
8 addToCtxt, setAccess, setTotal, addCtxtDef, addTyDecl, addDatatype,
9 addCasedef, addOperator,
9 addCasedef, addOperator,
10 lookupTy, lookupP, lookupDef, lookupVal, lookupTotal,
10 lookupTy, lookupP, lookupDef, lookupVal, lookupTotal,
11− lookupTyEnv, isConName,
11+ lookupTyEnv, isConName, isFnName,
12 Value(..)) where
12 Value(..)) where
14import Debug.Trace
14import Debug.Trace
@@ -656,6 +656,15 @@ isConName root n ctxt
656 (TyDecl (TCon _ _) _) -> return True
656 (TyDecl (TCon _ _) _) -> return True
657 _ -> return False
657 _ -> return False
659+isFnName :: Maybe [String] -> Name -> Context -> Bool
661+ = or $ do def <- lookupCtxt root n (definitions ctxt)
663+ (Function _ _) -> return True
664+ (Operator _ _ _) -> return True
665+ (CaseOp _ _ _ _ _ _ _) -> return True
659lookupP :: Maybe [String] -> Name -> Context -> [Term]
668lookupP :: Maybe [String] -> Name -> Context -> [Term]
660lookupP root n ctxt
669lookupP root n ctxt
661 = do def <- lookupCtxt root n (definitions ctxt)
670 = do def <- lookupCtxt root n (definitions ctxt)