1
0
forked from GitHub/gf-core

generalize the syntax for pre patterns

This commit is contained in:
krangelov
2021-12-20 15:44:30 +01:00
parent 2be3fd7e78
commit f2b6f36e02
3 changed files with 24 additions and 10 deletions

View File

@@ -213,6 +213,13 @@ inferLType gr g trm = case trm of
aa' <- flip mapM aa (\ (c,v) -> do
c' <- justCheck g c typeStr
v' <- checks $ map (justCheck g v) [typeStrs, EPattType typeStr]
v' <- case v' of
Q q -> do t <- lookupResDef gr q
t <- normalForm gr t
case t of
EPatt _ _ p -> mkStrs p
_ -> return v'
_ -> return v'
return (c',v'))
return (Alts t' aa', typeStr)