mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 03:32:51 -06:00
primitive pattern matching
This commit is contained in:
@@ -12,16 +12,9 @@ sizeParType cs = do
|
||||
return (sum scs, length cs)
|
||||
where
|
||||
sizeC (Con c ts) = do
|
||||
ats <- mapM lookParTypeSize ts
|
||||
ats <- mapM (lookEnv parsizes) ts
|
||||
return $ product ats
|
||||
|
||||
lookParTypeSize :: Type -> STM Env Int
|
||||
lookParTypeSize ty = case ty of
|
||||
TBas c -> do
|
||||
ty' <- lookEnv typedefs c
|
||||
lookParTypeSize ty'
|
||||
TVal i -> return $ fromInteger i
|
||||
|
||||
allParVals :: [Constr] -> STM Env [Exp]
|
||||
allParVals cs = do
|
||||
ess <- mapM alls cs
|
||||
|
||||
Reference in New Issue
Block a user