
14 Aug
2013
14 Aug
'13
5:25 a.m.
postgresql-simple declares Bool as an instance of the ToField class. The compiler can't deduce that given this simple code however: import Database.PostgreSQL.Simple.ToField (ToField(..)) foo :: (ToField a) => a foo = True It fails with this error: Db.hs:64:7: Could not deduce (a ~ Bool) from the context (ToField a) bound by the type signature for foo :: ToField a => a at Db.hs:63:8-23 `a' is a rigid type variable bound by the type signature for foo :: ToField a => a at Db.hs:63:8 In the expression: True In an equation for `foo': foo = True Failed, modules loaded: none. What am I missing?