diff options
Diffstat (limited to 'src/GF/Grammar/PatternMatch.hs')
| -rw-r--r-- | src/GF/Grammar/PatternMatch.hs | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/GF/Grammar/PatternMatch.hs b/src/GF/Grammar/PatternMatch.hs index 88e0f0441..2fcf4440a 100644 --- a/src/GF/Grammar/PatternMatch.hs +++ b/src/GF/Grammar/PatternMatch.hs @@ -1,18 +1,21 @@ ---------------------------------------------------------------------- -- | --- Module : (Module) --- Maintainer : (Maintainer) +-- Module : PatternMatch +-- Maintainer : AR -- Stability : (stable) -- Portability : (portable) -- --- > CVS $Date $ --- > CVS $Author $ --- > CVS $Revision $ +-- > CVS $Date: 2005/02/18 19:21:13 $ +-- > CVS $Author: peb $ +-- > CVS $Revision: 1.5 $ -- --- (Description of the module) +-- pattern matching for both concrete and abstract syntax. AR -- 16\/6\/2003 ----------------------------------------------------------------------------- -module PatternMatch where +module PatternMatch (matchPattern, + testOvershadow, + findMatch + ) where import Operations import Grammar @@ -23,8 +26,6 @@ import PrGrammar import List import Monad --- pattern matching for both concrete and abstract syntax. AR -- 16/6/2003 - matchPattern :: [(Patt,Term)] -> Term -> Err (Term, Substitution) matchPattern pts term = @@ -105,7 +106,7 @@ varsOfPatt p = case p of PT _ q -> varsOfPatt q _ -> [] --- to search matching parameter combinations in tables +-- | to search matching parameter combinations in tables isMatchingForms :: [Patt] -> [Term] -> Bool isMatchingForms ps ts = all match (zip ps ts') where match (PC c cs, (Cn d, ds)) = c == d && isMatchingForms cs ds |
