Ticket #4143: SetBug.hs
| File SetBug.hs, 350 bytes (added by japple, 3 years ago) |
|---|
| Line | |
|---|---|
| 1 | module SetBug 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.fromDistinctAscList [almostBig+1,almostBig+2] |
| 14 | violation = S.union smallSet almostBigSet |
| 15 | |
| 16 | main = print $ S.size violation |
