Skip to content

Commit b74b07d

Browse files
committed
Merge pull request #38 from purescript/revert-37-bounded-char-instance
Revert "Add Bounded Char instance"
2 parents bc9003d + 67c548a commit b74b07d

File tree

3 files changed

+8
-23
lines changed

3 files changed

+8
-23
lines changed

docs/Prelude.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -836,12 +836,6 @@ _left-associative / precedence 4_
836836

837837
Test whether one value is _non-strictly greater than_ another.
838838

839-
#### `unsafeCompare`
840-
841-
``` purescript
842-
unsafeCompare :: forall a. a -> a -> Ordering
843-
```
844-
845839
#### `Bounded`
846840

847841
``` purescript
@@ -866,7 +860,6 @@ instance boundedBoolean :: Bounded Boolean
866860
instance boundedUnit :: Bounded Unit
867861
instance boundedOrdering :: Bounded Ordering
868862
instance boundedInt :: Bounded Int
869-
instance boundedChar :: Bounded Char
870863
instance boundedFn :: (Bounded b) => Bounded (a -> b)
871864
```
872865

@@ -888,7 +881,6 @@ instance boundedOrdBoolean :: BoundedOrd Boolean
888881
instance boundedOrdUnit :: BoundedOrd Unit
889882
instance boundedOrdOrdering :: BoundedOrd Ordering
890883
instance boundedOrdInt :: BoundedOrd Int
891-
instance boundedOrdChar :: BoundedOrd Char
892884
```
893885

894886
#### `BooleanAlgebra`
@@ -983,4 +975,9 @@ instance showArray :: (Show a) => Show (Array a)
983975
instance showOrdering :: Show Ordering
984976
```
985977

978+
#### `unsafeCompare`
986979

980+
``` purescript
981+
unsafeCompare :: forall a. a -> a -> Ordering
982+
```
983+
The `unsafeCompare` function is mainly intended for module writers supporting native types via the FFI, and not for general comparisons.

src/Prelude.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,7 @@ exports.unsafeCompareImpl = function (lt) {
172172
};
173173
};
174174

175-
//- Bounded --------------------------------------------------------------------
176-
177-
exports.topChar = String.fromCharCode(65535);
178-
exports.bottomChar = String.fromCharCode(0);
179-
180-
//- BooleanAlgebra -------------------------------------------------------------
175+
//- Lattice --------------------------------------------------------------------
181176

182177
exports.boolOr = function (b1) {
183178
return function (b2) {
@@ -191,6 +186,8 @@ exports.boolAnd = function (b1) {
191186
};
192187
};
193188

189+
//- ComplementedLattice --------------------------------------------------------
190+
194191
exports.boolNot = function (b) {
195192
return !b;
196193
};

src/Prelude.purs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -737,18 +737,10 @@ instance boundedInt :: Bounded Int where
737737
top = 2147483647
738738
bottom = -2147483648
739739

740-
-- | Characters fall within the Unicode range.
741-
instance boundedChar :: Bounded Char where
742-
top = topChar
743-
bottom = bottomChar
744-
745740
instance boundedFn :: (Bounded b) => Bounded (a -> b) where
746741
top _ = top
747742
bottom _ = bottom
748743

749-
foreign import topChar :: Char
750-
foreign import bottomChar :: Char
751-
752744
-- | The `BoundedOrd` type class represents totally ordered finite data types.
753745
-- |
754746
-- | Instances should satisfy the following law in addition to the `Ord` laws:
@@ -760,7 +752,6 @@ instance boundedOrdBoolean :: BoundedOrd Boolean where
760752
instance boundedOrdUnit :: BoundedOrd Unit where
761753
instance boundedOrdOrdering :: BoundedOrd Ordering where
762754
instance boundedOrdInt :: BoundedOrd Int where
763-
instance boundedOrdChar :: BoundedOrd Char where
764755

765756
-- | The `BooleanAlgebra` type class represents types that behave like boolean
766757
-- | values.

0 commit comments

Comments
 (0)