summaryrefslogtreecommitdiff
path: root/src/GF/Grammar/LookAbs.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/GF/Grammar/LookAbs.hs')
-rw-r--r--src/GF/Grammar/LookAbs.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/GF/Grammar/LookAbs.hs b/src/GF/Grammar/LookAbs.hs
index 06e3ce3a5..ba809822a 100644
--- a/src/GF/Grammar/LookAbs.hs
+++ b/src/GF/Grammar/LookAbs.hs
@@ -105,6 +105,15 @@ allCatsOf gr =
isModAbs m,
(c, C.AbsCat cont _) <- tree2list (jments m)]
+allBindCatsOf :: GFCGrammar -> [Cat]
+allBindCatsOf gr =
+ nub [c | (i, ModMod m) <- modules gr,
+ isModAbs m,
+ (c, C.AbsFun typ _) <- tree2list (jments m),
+ Ok (cont,_) <- [firstTypeForm typ],
+ c <- concatMap fst $ errVal [] $ mapM (catSkeleton . snd) cont
+ ]
+
funsForType :: (Val -> Type -> Bool) -> GFCGrammar -> Val -> [(Fun,Type)]
funsForType compat gr val = [(fun,typ) | (fun,typ) <- funRulesOf gr,
compat val typ]