From c001455fc22ef1e171121fc32bbe537acd21a7fe Mon Sep 17 00:00:00 2001 From: Neil Brown <neil@twistedsquare.com> Date: Tue, 5 Feb 2008 22:18:22 +0000 Subject: [PATCH] Added a check for an empty list to oneofL --- common/FlowGraphTest.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/common/FlowGraphTest.hs b/common/FlowGraphTest.hs index 9b48a3a..f695269 100644 --- a/common/FlowGraphTest.hs +++ b/common/FlowGraphTest.hs @@ -459,6 +459,7 @@ nextIdT = modify' incId -- | A function similar to the QuickCheck oneof function, that works on GenL stuff rather than Gen. oneofL :: [GenL a] -> GenL a +oneofL [] = fail "Empty list fed to oneofL" oneofL gs = do i <- lift $ choose (0,length gs-1) gs !! i