From: simonpj Date: Mon, 2 Jun 2003 16:10:19 +0000 (+0000) Subject: [project @ 2003-06-02 16:10:19 by simonpj] X-Git-Tag: Approx_11550_changesets_converted~822 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=6d7921bb43458ebb30b9c6d94ad05a9e089b8997;p=ghc-hetmet.git [project @ 2003-06-02 16:10:19 by simonpj] Wibbles to tuples --- diff --git a/ghc/compiler/deSugar/DsUtils.lhs b/ghc/compiler/deSugar/DsUtils.lhs index 5191c9d..290ee47 100644 --- 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 +-- But there may be more than mAX_TUPLE_SIZE sub-lists 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 - -- 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 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}