Skip to content

Commit

Permalink
Support for Float, Double, and Rational results
Browse files Browse the repository at this point in the history
  • Loading branch information
lpsmith committed Dec 30, 2011
1 parent de79748 commit e20ffa2
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/Database/PostgreSQL/Simple/Result.hs
Original file line number Diff line number Diff line change
Expand Up @@ -121,22 +121,17 @@ instance Result Int64 where
instance Result Integer where
convert = atto ok64 $ signed decimal

{--
instance Result Float where
convert = atto ok (realToFrac <$> double)
where ok = mkCompats [Float,Double,Decimal,NewDecimal,Tiny,Short,Int24]
where ok = mkCompats [Float4,Int2]

instance Result Double where
convert = atto ok double
where ok = mkCompats [Float,Double,Decimal,NewDecimal,Tiny,Short,Int24,
Long]
--}
{--
where ok = mkCompats [Float4,Float8,Int2,Int4]

instance Result (Ratio Integer) where
convert = atto ok rational
where ok = mkCompats [Float,Double,Decimal,NewDecimal,Tiny,Short,Int24,
Long,LongLong]
--}
where ok = mkCompats [Float4,Float8,Int2,Int4,Numeric]

unBinary (Binary x) = x

Expand Down

0 comments on commit e20ffa2

Please sign in to comment.