primitive pattern matching

This commit is contained in:
aarne
2007-03-27 20:54:49 +00:00
parent 7c30d211c3
commit fd518ed2a3
9 changed files with 61 additions and 29 deletions

View File

@@ -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