Ticket #4143: SetBug3over8.hs
| File SetBug3over8.hs, 366 bytes (added by japple, 3 years ago) |
|---|
| Line | |
|---|---|
| 1 | module SetBug3over8 where |
| 2 | |
| 3 | import qualified SetLocalInt16 as S |
| 4 | import Data.Int |
| 5 | |
| 6 | big :: Int16 |
| 7 | big = maxBound |
| 8 | |
| 9 | almostBig :: Int16 |
| 10 | almostBig = (big `div` 2 + 1) `div` 2 |
| 11 | |
| 12 | almostBigSet = S.fromDistinctAscList [1..almostBig] |
| 13 | smallSet = S.fromList $ take (fromIntegral (almostBig`div`2)) [0,(-1)..] |
| 14 | violation = S.union almostBigSet smallSet |
| 15 | |
| 16 | main = print $ S.size violation |
