projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
eda8329
)
[project @ 2003-06-02 16:10:19 by simonpj]
author
simonpj
<unknown>
Mon, 2 Jun 2003 16:10:19 +0000
(16:10 +0000)
committer
simonpj
<unknown>
Mon, 2 Jun 2003 16:10:19 +0000
(16:10 +0000)
Wibbles to tuples
ghc/compiler/deSugar/DsUtils.lhs
patch
|
blob
|
history
diff --git
a/ghc/compiler/deSugar/DsUtils.lhs
b/ghc/compiler/deSugar/DsUtils.lhs
index
5191c9d
..
290ee47
100644
(file)
--- a/
ghc/compiler/deSugar/DsUtils.lhs
+++ b/
ghc/compiler/deSugar/DsUtils.lhs
@@
-597,17
+597,14
@@
mkTupleExpr ids
chunkify :: [a] -> [[a]]
-- The sub-lists of the result all have length <= mAX_TUPLE_SIZE
chunkify :: [a] -> [[a]]
-- The sub-lists of the result all have length <= mAX_TUPLE_SIZE
+-- But there may be more than mAX_TUPLE_SIZE sub-lists
chunkify xs
chunkify xs
- | n_xs <= mAX_TUPLE_SIZE = [xs]
- | otherwise = split xs
+ | n_xs <= mAX_TUPLE_SIZE = pprTrace "Small" (ppr n_xs) [xs]
+ | otherwise = pprTrace "Big" (ppr n_xs) (split xs)
where
where
- -- n_chunks_m1 = numbe of chunks - 1
- n_xs = length xs
- n_chunks_m1 = n_xs `div` mAX_TUPLE_SIZE
- chunk_size = n_xs `div` n_chunks_m1
-
+ n_xs = length xs
split [] = []
split [] = []
- split xs = take chunk_size xs : split (drop chunk_size xs)
+ split xs = take mAX_TUPLE_SIZE xs : split (drop mAX_TUPLE_SIZE xs)
\end{code}
\end{code}