[QuickCheck: improve distribution of randomPossWithSubterms
Helmut Grohne <grohne@cs.uni-bonn.de>**20150508144054
 Ignore-this: 38361a0af7fab9999727622b0beeb486
 
 The number of non-overlapping positions in a term (after shuffling) can be
 significantly smaller than the number of leaf terms (its size). Thus
 randomPossWithSubterms would prefer to replace most positions.
 
] hunk ./src/Tests.hs 98
-    numSubsts <- chooseLog (size term)
-    poss <- liftM (take numSubsts) $ nonOverlappingPos term
-    return $ map (\pos -> (pos, fromJust (subtermAt term pos))) poss
+    poss <- nonOverlappingPos term
+    numSubsts <- chooseLog (succ (length poss))
+    return [ (pos, fromJust (subtermAt term pos)) | pos <- take numSubsts poss ]