Skip to content

Commit

Permalink
Support unpacking DB Int as Double
Browse files Browse the repository at this point in the history
  • Loading branch information
maksbotan committed Sep 28, 2023
1 parent 9d5e9d7 commit e77f60c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Database/Bolt/Extras/Internal/Instances.hs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import Database.Bolt.Extras.Internal.Types (FromValue (..), NodeLike (
NodeLikeProps (..), ToIsValue (..),
ToValue (..))
import Database.Bolt.Extras.Utils (currentLoc)
import GHC.Float (double2Float, float2Double)
import GHC.Float (double2Float, float2Double, int2Double)
import GHC.Stack (HasCallStack)


Expand Down Expand Up @@ -80,6 +80,7 @@ instance FromValue Int where

instance FromValue Double where
fromValue (F doubleV) = doubleV
fromValue (I intV) = int2Double intV
fromValue v = error $ $currentLoc ++ "could not unpack " ++ show v ++ " into Double"

instance FromValue Float where
Expand Down

0 comments on commit e77f60c

Please sign in to comment.