futhark-data 1.0.0.0 → 1.0.0.1
raw patch · 3 files changed
+11/−6 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- futhark-data.cabal +1/−1
- src/Futhark/Data/Compare.hs +6/−5
CHANGELOG.md view
@@ -1,5 +1,9 @@ # Revision history for futhark-data +## 1.0.0.1 -- 2021-06-09++* Fixed crash in value comparison.+ ## 1.0.0.0 -- 2021-06-08 * First version. Released on an unsuspecting world.
futhark-data.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.4 name: futhark-data-version: 1.0.0.0+version: 1.0.0.1 synopsis: An implementation of the Futhark data format. description: The Futhark compiler and its tools uses a simple external
src/Futhark/Data/Compare.hs view
@@ -110,15 +110,16 @@ [ArrayShapeMismatch i (valueShape got_v) (valueShape expected_v)] where unflatten = unflattenIndex (valueShape got_v)- value = undefined+ value :: Show a => a -> T.Text+ value = T.pack . show {-# INLINE compareGen #-} {-# INLINE compareNum #-} {-# INLINE compareFloat #-} {-# INLINE compareFloatElement #-} {-# INLINE compareElement #-}- compareNum :: (SVec.Storable a, Eq a) => SVec.Vector a -> SVec.Vector a -> [Mismatch]+ compareNum :: (SVec.Storable a, Eq a, Show a) => SVec.Vector a -> SVec.Vector a -> [Mismatch] compareNum = compareGen compareElement- compareFloat :: (SVec.Storable a, RealFloat a) => a -> SVec.Vector a -> SVec.Vector a -> [Mismatch]+ compareFloat :: (SVec.Storable a, RealFloat a, Show a) => a -> SVec.Vector a -> SVec.Vector a -> [Mismatch] compareFloat = compareGen . compareFloatElement compareGen cmp got expected =@@ -134,12 +135,12 @@ acc in reverse $ check [] 0 - compareElement :: Eq a => Int -> a -> a -> Maybe Mismatch+ compareElement :: (Show a, Eq a) => Int -> a -> a -> Maybe Mismatch compareElement j got expected | got == expected = Nothing | otherwise = Just $ PrimValueMismatch i (unflatten j) (value got) (value expected) - compareFloatElement :: RealFloat a => a -> Int -> a -> a -> Maybe Mismatch+ compareFloatElement :: (Show a, RealFloat a) => a -> Int -> a -> a -> Maybe Mismatch compareFloatElement abstol j got expected | isNaN got, isNaN expected =