Skip to content
This repository was archived by the owner on Oct 4, 2020. It is now read-only.

Commit fdfbb6e

Browse files
committed
newtype derive instances for Bounded
1 parent aa5bf21 commit fdfbb6e

File tree

5 files changed

+7
-17
lines changed

5 files changed

+7
-17
lines changed

src/Data/Monoid/Additive.purs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ derive newtype instance eqAdditive :: Eq a => Eq (Additive a)
2323

2424
derive newtype instance ordAdditive :: Ord a => Ord (Additive a)
2525

26-
instance boundedAdditive :: Bounded a => Bounded (Additive a) where
27-
top = Additive top
28-
bottom = Additive bottom
26+
derive newtype instance boundedAdditive :: Bounded a => Bounded (Additive a)
2927

3028
instance functorAdditive :: Functor Additive where
3129
map f (Additive x) = Additive (f x)

src/Data/Monoid/Conj.purs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ derive newtype instance eqConj :: Eq a => Eq (Conj a)
2424

2525
derive newtype instance ordConj :: Ord a => Ord (Conj a)
2626

27-
instance boundedConj :: Bounded a => Bounded (Conj a) where
28-
top = Conj top
29-
bottom = Conj bottom
27+
derive newtype instance boundedConj :: Bounded a => Bounded (Conj a)
3028

3129
instance functorConj :: Functor Conj where
3230
map f (Conj x) = Conj (f x)

src/Data/Monoid/Disj.purs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ derive newtype instance eqDisj :: Eq a => Eq (Disj a)
2424

2525
derive newtype instance ordDisj :: Ord a => Ord (Disj a)
2626

27-
instance boundedDisj :: Bounded a => Bounded (Disj a) where
28-
top = Disj top
29-
bottom = Disj bottom
27+
derive newtype instance boundedDisj :: Bounded a => Bounded (Disj a)
3028

3129
instance functorDisj :: Functor Disj where
3230
map f (Disj x) = Disj (f x)

src/Data/Monoid/Dual.purs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ derive newtype instance eqDual :: Eq a => Eq (Dual a)
2323

2424
derive newtype instance ordDual :: Ord a => Ord (Dual a)
2525

26-
instance boundedDual :: Bounded a => Bounded (Dual a) where
27-
top = Dual top
28-
bottom = Dual bottom
26+
derive newtype instance boundedDual :: Bounded a => Bounded (Dual a)
2927

3028
instance functorDual :: Functor Dual where
3129
map f (Dual x) = Dual (f x)

src/Data/Monoid/Multiplicative.purs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@ newtype Multiplicative a = Multiplicative a
1919

2020
derive instance newtypeMultiplicative :: Newtype (Multiplicative a) _
2121

22-
derive newtype instance eqMultiplicative :: (Eq a) => Eq (Multiplicative a)
22+
derive newtype instance eqMultiplicative :: Eq a => Eq (Multiplicative a)
2323

24-
derive newtype instance ordMultiplicative :: (Ord a) => Ord (Multiplicative a)
24+
derive newtype instance ordMultiplicative :: Ord a => Ord (Multiplicative a)
2525

26-
instance boundedMultiplicative :: Bounded a => Bounded (Multiplicative a) where
27-
top = Multiplicative top
28-
bottom = Multiplicative bottom
26+
derive newtype instance boundedMultiplicative :: Bounded a => Bounded (Multiplicative a)
2927

3028
instance functorMultiplicative :: Functor Multiplicative where
3129
map f (Multiplicative x) = Multiplicative (f x)

0 commit comments

Comments
 (0)