Permalink
Browse files

Use length instead of genericLength, to avoid a space leak

  • Loading branch information...
ndmitchell committed Sep 17, 2015
1 parent 940412c commit 12c46e93be2e7dbb6e2cfe7f42e707d6be8e511f
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/Output/Types.hs
View
@@ -111,7 +111,7 @@ writeNames store debug inst xs = do
-- Aim for something with a count of p to be at position (p / pmax) linear interp over the range
spreadNames :: [(a, Int)] -> [(a, Name)]
spreadNames [] = []
-spreadNames (reverse . sortOn snd -> xs@((_,limit):_)) = check $ f (99 + genericLength xs) maxBound xs
+spreadNames (reverse . sortOn snd -> xs@((_,limit):_)) = check $ f (99 + fromIntegral (length xs)) maxBound xs
where
check xs | all (isCon . snd) xs && length (nubOrd $ map snd xs) == length xs = xs
| otherwise = error "Invalid spreadNames"

0 comments on commit 12c46e9

Please sign in to comment.