projects
/
matthijs
/
master-project
/
cλash.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ade1311
)
Learn flattenExpr about building tuples.
author
Matthijs Kooijman
<m.kooijman@student.utwente.nl>
Wed, 11 Feb 2009 11:37:50 +0000
(12:37 +0100)
committer
Matthijs Kooijman
<m.kooijman@student.utwente.nl>
Wed, 11 Feb 2009 11:37:50 +0000
(12:37 +0100)
Flatten.hs
patch
|
blob
|
history
diff --git
a/Flatten.hs
b/Flatten.hs
index 9d050435602a908b2a4e50aa0261c50e7fc18ef8..7dc261e8d23138f90865b0f083ec45f04c71f598 100644
(file)
--- a/
Flatten.hs
+++ b/
Flatten.hs
@@
-259,7
+259,14
@@
flattenExpr binds app@(App _ _) = do
let ((Var f), args) = collectArgs app in
flattenApplicationExpr binds (CoreUtils.exprType app) f args
where
let ((Var f), args) = collectArgs app in
flattenApplicationExpr binds (CoreUtils.exprType app) f args
where
- flattenBuildTupleExpr = error $ "Tuple construction not supported: " ++ (showSDoc $ ppr app)
+ flattenBuildTupleExpr binds args = do
+ -- Flatten each of our args
+ flat_args <- (State.mapM (flattenExpr binds) args)
+ -- Check and split each of the arguments
+ let (_, arg_ress) = unzip (zipWith checkArg args flat_args)
+ let res = Tuple arg_ress
+ return ([], res)
+
-- | Flatten a normal application expression
flattenApplicationExpr binds ty f args = do
-- Find the function to call
-- | Flatten a normal application expression
flattenApplicationExpr binds ty f args = do
-- Find the function to call