summaryrefslogtreecommitdiff
path: root/src/GF/Grammar/Macros.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/GF/Grammar/Macros.hs')
-rw-r--r--src/GF/Grammar/Macros.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/GF/Grammar/Macros.hs b/src/GF/Grammar/Macros.hs
index e7d073382..a3cad8bae 100644
--- a/src/GF/Grammar/Macros.hs
+++ b/src/GF/Grammar/Macros.hs
@@ -136,6 +136,10 @@ isRecursiveType t = errVal False $ do
(cc,c) <- catSkeleton t -- thus recursivity on Cat level
return $ any (== c) cc
+isHigherOrderType :: Type -> Bool
+isHigherOrderType t = errVal True $ do -- pessimistic choice
+ co <- contextOfType t
+ return $ not $ null [x | (x,Prod _ _ _) <- co]
contextOfType :: Type -> Err Context
contextOfType typ = case typ of