@@ -8,7 +8,7 @@ module Core.Evaluate(normalise, normaliseC, normaliseAll,
88 addToCtxt, setAccess, setTotal, addCtxtDef, addTyDecl, addDatatype,
99 addCasedef, addOperator,
1010 lookupTy, lookupP, lookupDef, lookupVal, lookupTotal,
11− lookupTyEnv, isConName,
11+ lookupTyEnv, isConName, isFnName,
1212 Value(..)) where
1313
1414import Debug.Trace
@@ -656,6 +656,15 @@ isConName root n ctxt
656656 (TyDecl (TCon _ _) _) -> return True
657657 _ -> return False
658658
659+isFnName :: Maybe [String] -> Name -> Context -> Bool
660+isFnName root n ctxt
661+ = or $ do def <- lookupCtxt root n (definitions ctxt)
662+ case tfst def of
663+ (Function _ _) -> return True
664+ (Operator _ _ _) -> return True
665+ (CaseOp _ _ _ _ _ _ _) -> return True
666+ _ -> return False
667+
659668lookupP :: Maybe [String] -> Name -> Context -> [Term]
660669lookupP root n ctxt
661670 = do def <- lookupCtxt root n (definitions ctxt)