From 3a9b40dc0d378a65beaf999e746af20a3879284d Mon Sep 17 00:00:00 2001 From: David Johnson Date: Wed, 6 Nov 2019 11:04:49 -0500 Subject: [PATCH] Remove Ord instance from Array. --- src/ArrayFire.hs | 8 +------- src/ArrayFire/Orphans.hs | 6 ------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/ArrayFire.hs b/src/ArrayFire.hs index 65eba52..339c48f 100644 --- a/src/ArrayFire.hs +++ b/src/ArrayFire.hs @@ -201,7 +201,7 @@ import Data.Word -- Specifying up to 4 dimensions is allowed (anything high is ignored). -- $laws --- Every 'Array' is an instance of 'Eq', 'Ord', 'Num', 'Fractional', 'Floating' +-- Every 'Array' is an instance of 'Eq', 'Num', 'Fractional', 'Floating' -- -- 'Num' -- @@ -240,12 +240,6 @@ import Data.Word -- >>> scalar @Double 1 [10] /= scalar @Double 1 [10] -- False -- --- 'Ord' --- --- >>> scalar @Double 1 [10] < scalar @Double 1 [10] --- False --- >>> scalar @Double 1 [10] > scalar @Double 1 [10] --- False -- -- 'Floating' -- diff --git a/src/ArrayFire/Orphans.hs b/src/ArrayFire/Orphans.hs index 2c8b7c5..690a89d 100644 --- a/src/ArrayFire/Orphans.hs +++ b/src/ArrayFire/Orphans.hs @@ -39,12 +39,6 @@ instance (Num a, AFType a) => Num (Array a) where x - y = A.sub x y fromInteger = A.scalar . fromIntegral -instance (Ord a, AFType a) => Ord (Array a) where - x < y = A.allTrueAll (A.ltBatched x y False) == (1.0,0.0) - x > y = A.allTrueAll (A.gtBatched x y False) == (1.0,0.0) - x <= y = A.allTrueAll (A.leBatched x y False) == (1.0,0.0) - x >= y = A.allTrueAll (A.geBatched x y False) == (1.0,0.0) - instance Show (Array a) where show = arrayString