From b96b36f43de3e2f8b58d5f539daa6f6d47f25870 Mon Sep 17 00:00:00 2001 From: aarne Date: Wed, 25 Jun 2008 16:43:48 +0000 Subject: removed src for 2.9 --- src/GF/UseGrammar/MatchTerm.hs | 50 ------------------------------------------ 1 file changed, 50 deletions(-) delete mode 100644 src/GF/UseGrammar/MatchTerm.hs (limited to 'src/GF/UseGrammar/MatchTerm.hs') diff --git a/src/GF/UseGrammar/MatchTerm.hs b/src/GF/UseGrammar/MatchTerm.hs deleted file mode 100644 index 9acffd44c..000000000 --- a/src/GF/UseGrammar/MatchTerm.hs +++ /dev/null @@ -1,50 +0,0 @@ ----------------------------------------------------------------------- --- | --- Module : MatchTerm --- Maintainer : AR --- Stability : (stable) --- Portability : (portable) --- --- --- functions for matching with terms. AR 16/3/2006 ------------------------------------------------------------------------------ - -module GF.UseGrammar.MatchTerm where - -import GF.Data.Operations -import GF.Data.Zipper - -import GF.Grammar.Grammar -import GF.Grammar.PrGrammar -import GF.Infra.Ident -import GF.Grammar.Values -import GF.Grammar.Macros -import GF.Grammar.MMacros - -import Control.Monad -import Data.List - --- test if a term has duplicated idents, either any or just atoms - -hasDupIdent, hasDupAtom :: Exp -> Bool -hasDupIdent = (>1) . maximum . map length . group . sort . allConstants True -hasDupAtom = (>1) . maximum . map length . group . sort . allConstants False - --- test if a certain ident occurs in term - -grepIdent :: Ident -> Exp -> Bool -grepIdent c = elem c . allConstants True - --- form the list of all constants, optionally ignoring all but atoms - -allConstants :: Bool -> Exp -> [Ident] -allConstants alsoApp = err (const []) snd . flip appSTM [] . collect where - collect e = case e of - Q _ c -> add c e - QC _ c -> add c e - Cn c -> add c e - App f a | not alsoApp -> case f of - App g b -> collect b >> collect a - _ -> collect a - _ -> composOp collect e - add c e = updateSTM (c:) >> return e -- cgit v1.2.3