Skip to content

Commit 7abfd48

Browse files
committed
Remove Semigroup.
1 parent d495366 commit 7abfd48

File tree

3 files changed

+2
-15
lines changed

3 files changed

+2
-15
lines changed

src/ArrayFire.hs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ import Data.Word
199199
-- Specifying up to 4 dimensions is allowed (anything high is ignored).
200200

201201
-- $laws
202-
-- Every 'Array' is an instance of 'Eq', 'Ord', 'Num', 'Fractional', 'Floating' and 'Semigroup'
202+
-- Every 'Array' is an instance of 'Eq', 'Ord', 'Num', 'Fractional', 'Floating'
203203
--
204204
-- 'Num'
205205
--
@@ -231,16 +231,6 @@ import Data.Word
231231
-- [1 1 1 1]
232232
-- 1.0000
233233
--
234-
-- 'Semigroup'
235-
--
236-
-- /'Array' forms a 'Semigroup' via pointwise-multiplication./
237-
--
238-
-- >>> matrix @Double (2,2) [[1,2],[3,4]] <> matrix @Double (2,2) [[1,2],[3,4]]
239-
-- ArrayFire Array
240-
-- [2 2 1 1]
241-
-- 1.0000 4.0000
242-
-- 9.0000 16.0000
243-
--
244234
-- 'Eq'
245235
--
246236
-- >>> scalar @Double 1 [10] == scalar @Double 1 [10]

src/ArrayFire/Orphans.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ instance (Ord a, AFType a) => Ord (Array a) where
4545
x <= y = toEnum . fromIntegral $ A.getScalar @CBool @a (A.le x y)
4646
x >= y = toEnum . fromIntegral $ A.getScalar @CBool @a (A.ge x y)
4747

48-
instance (Fractional a, AFType a) => Semigroup (Array a) where
49-
(<>) = A.mul
50-
5148
instance Show (Array a) where
5249
show = arrayString
5350

test/ArrayFire/ArithSpec.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ spec =
2020
it "Should subtract two scalar arrays" $ do
2121
scalar @Int 4 - 2 `shouldBe` 2
2222
it "Should multiply two scalar arrays" $ do
23-
scalar @Double 4 <> 2 `shouldBe` 8
23+
scalar @Double 4 `mul` 2 `shouldBe` 8
2424
it "Should divide two scalar arrays" $ do
2525
div @Double 8 2 `shouldBe` 4
2626
it "Should add two matrices" $ do

0 commit comments

Comments
 (0)