on master help sign in
Use the "cmp" from mutable array module
commitacf60e7f5dcd759c71f5f44eafca4eb88c31a800 authorHarendra Kumar <harendra@composewell.com> dateSat 16 Oct 2021, 16:48 (5 years ago) parentd86e604
1 file changed+1−1
src/Streamly/Internal/Data/Array/Foreign/Type.hs+1−1
src/Streamly/Internal/Data/Array/Foreign/Type.hs+1−1
@@ -597,7 +597,7 @@ instance Storable a => IsList (Array a) where
597597-- or may not be correct? arrcmp is 40% faster compared to stream equality.
598598instance (Storable a, Eq a) => Eq (Array a) where
599599 {-# INLINE (==) #-}
600− arr1 == arr2 = runIdentity $ D.eqBy (==) (toStreamD arr1) (toStreamD arr2)
600+ arr1 == arr2 = unsafeInlineIO $! unsafeThaw arr1 `MA.cmp` unsafeThaw arr2
601601
602602-- Since this is a Storable array we cannot have unevaluated data in it so
603603-- this is just a no op.