SIZE=1000 MODULE=ManyAlternatives # Generates a module with a large number of alternatives that looks # like this: # # module ManyAlternatives where # # data A1000 = A0 # | A0001 # | A0002 # ... # | A1000 # # f :: A -> Int # f A0001 = 1990001 # f A0002 = 1990002 # ... # f A1000 = 1991000 # # The point of this test is to check if we don't regress on #14667 reintroducing # some code that's quadratic in the number of alternatives. echo "module $MODULE where" > $MODULE.hs echo >> $MODULE.hs echo "data A$SIZE = A0" >> $MODULE.hs for i in $(seq -w 1 $SIZE); do echo " | A$i" >> $MODULE.hs done echo >> $MODULE.hs echo "f :: A$SIZE -> Int" >> $MODULE.hs for i in $(seq -w 1 $SIZE); do echo "f A$i = 199$i" >> $MODULE.hs done