Skip to content

Commit fa7d8d2

Browse files
Add kind signatures to record type classes to remove warnings
1 parent 7a99f83 commit fa7d8d2

File tree

9 files changed

+16
-19
lines changed

9 files changed

+16
-19
lines changed

src/Data/BooleanAlgebra.purs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ instance booleanAlgebraProxy3 :: BooleanAlgebra (Proxy3 a)
3131

3232
-- | A class for records where all fields have `BooleanAlgebra` instances, used
3333
-- | to implement the `BooleanAlgebra` instance for records.
34+
class BooleanAlgebraRecord :: RL.RowList Type -> Row Type -> Row Type -> Constraint
3435
class HeytingAlgebraRecord rowlist row subrow <= BooleanAlgebraRecord rowlist row subrow | rowlist -> subrow
3536

3637
instance booleanAlgebraRecordNil :: BooleanAlgebraRecord RL.Nil row ()

src/Data/Bounded.purs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@ module Data.Bounded
77
) where
88

99
import Data.Ord (class Ord, class OrdRecord, Ordering(..), compare, (<), (<=), (>), (>=))
10-
import Data.Symbol (class IsSymbol, SProxy(..), reflectSymbol)
10+
import Data.Symbol (class IsSymbol, reflectSymbol)
1111
import Data.Unit (Unit, unit)
1212
import Prim.Row as Row
1313
import Prim.RowList as RL
1414
import Record.Unsafe (unsafeSet)
15-
import Type.Data.Row (RProxy(..))
16-
import Type.Data.RowList (RLProxy(..))
1715
import Type.Proxy (Proxy(..), Proxy2(..), Proxy3(..))
1816

1917
-- | The `Bounded` type class represents totally ordered types that have an
@@ -75,6 +73,7 @@ instance boundedProxy3 :: Bounded (Proxy3 a) where
7573
bottom = Proxy3
7674
top = Proxy3
7775

76+
class BoundedRecord :: RL.RowList Type -> Row Type -> Row Type -> Constraint
7877
class OrdRecord rowlist row <= BoundedRecord rowlist row subrow | rowlist -> subrow where
7978
topRecord :: forall rlproxy rproxy. rlproxy rowlist -> rproxy row -> Record subrow
8079
bottomRecord :: forall rlproxy rproxy. rlproxy rowlist -> rproxy row -> Record subrow

src/Data/Eq.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ module Data.Eq
55
) where
66

77
import Data.HeytingAlgebra ((&&))
8-
import Data.Symbol (class IsSymbol, SProxy(..), reflectSymbol)
8+
import Data.Symbol (class IsSymbol, reflectSymbol)
99
import Data.Unit (Unit)
1010
import Data.Void (Void)
1111
import Prim.Row as Row
1212
import Prim.RowList as RL
1313
import Record.Unsafe (unsafeGet)
14-
import Type.Data.RowList (RLProxy(..))
1514
import Type.Proxy (Proxy(..), Proxy2, Proxy3)
1615

1716
-- | The `Eq` type class represents types which support decidable equality.
@@ -94,6 +93,7 @@ notEq1 x y = (x `eq1` y) == false
9493

9594
-- | A class for records where all fields have `Eq` instances, used to implement
9695
-- | the `Eq` instance for records.
96+
class EqRecord :: RL.RowList Type -> Row Type -> Constraint
9797
class EqRecord rowlist row where
9898
eqRecord :: forall rlproxy. rlproxy rowlist -> Record row -> Record row -> Boolean
9999

src/Data/HeytingAlgebra.purs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@ module Data.HeytingAlgebra
33
, class HeytingAlgebraRecord, ffRecord, ttRecord, impliesRecord, conjRecord, disjRecord, notRecord
44
) where
55

6-
import Data.Symbol (class IsSymbol, SProxy(..), reflectSymbol)
6+
import Data.Symbol (class IsSymbol, reflectSymbol)
77
import Data.Unit (Unit, unit)
88
import Prim.Row as Row
99
import Prim.RowList as RL
1010
import Record.Unsafe (unsafeGet, unsafeSet)
11-
import Type.Data.Row (RProxy(..))
12-
import Type.Data.RowList (RLProxy(..))
1311
import Type.Proxy (Proxy(..), Proxy2(..), Proxy3(..))
1412

1513
-- | The `HeytingAlgebra` type class represents types that are bounded lattices with
@@ -110,6 +108,7 @@ foreign import boolNot :: Boolean -> Boolean
110108

111109
-- | A class for records where all fields have `HeytingAlgebra` instances, used
112110
-- | to implement the `HeytingAlgebra` instance for records.
111+
class HeytingAlgebraRecord :: RL.RowList Type -> Row Type -> Row Type -> Constraint
113112
class HeytingAlgebraRecord rowlist row subrow | rowlist -> subrow where
114113
ffRecord :: forall rlproxy rproxy. rlproxy rowlist -> rproxy row -> Record subrow
115114
ttRecord :: forall rlproxy rproxy. rlproxy rowlist -> rproxy row -> Record subrow

src/Data/Ord.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,14 @@ module Data.Ord
1616
) where
1717

1818
import Data.Eq (class Eq, class Eq1, class EqRecord, (/=))
19-
import Data.Symbol (class IsSymbol, SProxy(..), reflectSymbol)
19+
import Data.Symbol (class IsSymbol, reflectSymbol)
2020
import Data.Ordering (Ordering(..))
2121
import Data.Ring (class Ring, zero, one, negate)
2222
import Data.Unit (Unit)
2323
import Data.Void (Void)
2424
import Prim.Row as Row
2525
import Prim.RowList as RL
2626
import Record.Unsafe (unsafeGet)
27-
import Type.Data.RowList (RLProxy(..))
2827
import Type.Proxy (Proxy(..), Proxy2, Proxy3)
2928

3029
-- | The `Ord` type class represents types which support comparisons with a
@@ -224,6 +223,7 @@ class Eq1 f <= Ord1 f where
224223
instance ord1Array :: Ord1 Array where
225224
compare1 = compare
226225

226+
class OrdRecord :: RL.RowList Type -> Row Type -> Constraint
227227
class EqRecord rowlist row <= OrdRecord rowlist row where
228228
compareRecord :: forall rlproxy. rlproxy rowlist -> Record row -> Record row -> Ordering
229229

src/Data/Ring.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@ module Data.Ring
55
) where
66

77
import Data.Semiring (class Semiring, class SemiringRecord, add, mul, one, zero, (*), (+))
8-
import Data.Symbol (class IsSymbol, SProxy(..), reflectSymbol)
8+
import Data.Symbol (class IsSymbol, reflectSymbol)
99
import Data.Unit (Unit, unit)
1010
import Prim.Row as Row
1111
import Prim.RowList as RL
1212
import Record.Unsafe (unsafeGet, unsafeSet)
13-
import Type.Data.RowList (RLProxy(..))
1413
import Type.Proxy (Proxy(..), Proxy2(..), Proxy3(..))
1514

1615
-- | The `Ring` class is for types that support addition, multiplication,
@@ -58,6 +57,7 @@ foreign import numSub :: Number -> Number -> Number
5857

5958
-- | A class for records where all fields have `Ring` instances, used to
6059
-- | implement the `Ring` instance for records.
60+
class RingRecord :: RL.RowList Type -> Row Type -> Row Type -> Constraint
6161
class SemiringRecord rowlist row subrow <= RingRecord rowlist row subrow | rowlist -> subrow where
6262
subRecord :: forall rlproxy. rlproxy rowlist -> Record row -> Record row -> Record subrow
6363

src/Data/Semigroup.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@ module Data.Semigroup
33
, class SemigroupRecord, appendRecord
44
) where
55

6-
import Data.Symbol (class IsSymbol, SProxy(..), reflectSymbol)
6+
import Data.Symbol (class IsSymbol, reflectSymbol)
77
import Data.Unit (Unit, unit)
88
import Data.Void (Void, absurd)
99
import Prim.Row as Row
1010
import Prim.RowList as RL
1111
import Record.Unsafe (unsafeGet, unsafeSet)
12-
import Type.Data.RowList (RLProxy(..))
1312
import Type.Proxy (Proxy(..), Proxy2(..), Proxy3(..))
1413

1514
-- | The `Semigroup` type class identifies an associative operation on a type.
@@ -66,6 +65,7 @@ foreign import concatArray :: forall a. Array a -> Array a -> Array a
6665

6766
-- | A class for records where all fields have `Semigroup` instances, used to
6867
-- | implement the `Semigroup` instance for records.
68+
class SemigroupRecord :: RL.RowList Type -> Row Type -> Row Type -> Constraint
6969
class SemigroupRecord rowlist row subrow | rowlist -> subrow where
7070
appendRecord :: forall rlproxy. rlproxy rowlist -> Record row -> Record row -> Record subrow
7171

src/Data/Semiring.purs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@ module Data.Semiring
33
, class SemiringRecord, addRecord, mulRecord, oneRecord, zeroRecord
44
) where
55

6-
import Data.Symbol (class IsSymbol, SProxy(..), reflectSymbol)
6+
import Data.Symbol (class IsSymbol, reflectSymbol)
77
import Data.Unit (Unit, unit)
88
import Prim.Row as Row
99
import Prim.RowList as RL
1010
import Record.Unsafe (unsafeGet, unsafeSet)
11-
import Type.Data.Row (RProxy(..))
12-
import Type.Data.RowList (RLProxy(..))
1311
import Type.Proxy (Proxy(..), Proxy2(..), Proxy3(..))
1412

1513
-- | The `Semiring` class is for types that support an addition and
@@ -97,6 +95,7 @@ foreign import numMul :: Number -> Number -> Number
9795

9896
-- | A class for records where all fields have `Semiring` instances, used to
9997
-- | implement the `Semiring` instance for records.
98+
class SemiringRecord :: RL.RowList Type -> Row Type -> Row Type -> Constraint
10099
class SemiringRecord rowlist row subrow | rowlist -> subrow where
101100
addRecord :: forall rlproxy. rlproxy rowlist -> Record row -> Record row -> Record subrow
102101
mulRecord :: forall rlproxy. rlproxy rowlist -> Record row -> Record row -> Record subrow

src/Data/Show.purs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ module Data.Show
33
, class ShowRecordFields, showRecordFields
44
) where
55

6-
import Data.Symbol (class IsSymbol, SProxy(..), reflectSymbol)
6+
import Data.Symbol (class IsSymbol, reflectSymbol)
77
import Prim.RowList as RL
88
import Record.Unsafe (unsafeGet)
9-
import Type.Data.RowList (RLProxy(..))
109
import Type.Proxy (Proxy(..), Proxy2, Proxy3)
1110

1211
-- | The `Show` type class represents those types which can be converted into

0 commit comments

Comments
 (0)