IreneKnapp/direct-sqlite — pull request #36 by nurpax (2013-10-13 20:16:46+00:00)
Title: Narrow Param/ColumnIndex bounds down to native C 'int' size

SQLite3 accepts column and parameter indices as native 'int's, which
on 64-bit systems is usually only 32-bits whereas Haskell's Int is
64-bits on 64-bit systems. Add Bounded instances for ParamIndex and
ColumnIndex to mark the allowable integer range for these values.

No explicit overflow checking is done for these values as this is
somewhat of a corner case and we don't want to pay any extra for such
often used values.

Fixes a test failure reported in #32

---
FYI, tested

print (minBound :: ColumnIndex)
print (maxBound :: ColumnIndex)
print (minBound :: ParamIndex)
print (maxBound :: ParamIndex)

and these correctly print -2147483648 & 2147483647 as expected.