From 67c548a09cd8d4360311779cf282f61404c3e655 Mon Sep 17 00:00:00 2001 From: Phil Freeman Date: Thu, 13 Aug 2015 06:49:35 -0700 Subject: [PATCH] Revert "Add Bounded Char instance" --- docs/Prelude.md | 13 +++++-------- src/Prelude.js | 9 +++------ src/Prelude.purs | 9 --------- 3 files changed, 8 insertions(+), 23 deletions(-) diff --git a/docs/Prelude.md b/docs/Prelude.md index df56019c..679f28eb 100644 --- a/docs/Prelude.md +++ b/docs/Prelude.md @@ -836,12 +836,6 @@ _left-associative / precedence 4_ Test whether one value is _non-strictly greater than_ another. -#### `unsafeCompare` - -``` purescript -unsafeCompare :: forall a. a -> a -> Ordering -``` - #### `Bounded` ``` purescript @@ -866,7 +860,6 @@ instance boundedBoolean :: Bounded Boolean instance boundedUnit :: Bounded Unit instance boundedOrdering :: Bounded Ordering instance boundedInt :: Bounded Int -instance boundedChar :: Bounded Char instance boundedFn :: (Bounded b) => Bounded (a -> b) ``` @@ -888,7 +881,6 @@ instance boundedOrdBoolean :: BoundedOrd Boolean instance boundedOrdUnit :: BoundedOrd Unit instance boundedOrdOrdering :: BoundedOrd Ordering instance boundedOrdInt :: BoundedOrd Int -instance boundedOrdChar :: BoundedOrd Char ``` #### `BooleanAlgebra` @@ -983,4 +975,9 @@ instance showArray :: (Show a) => Show (Array a) instance showOrdering :: Show Ordering ``` +#### `unsafeCompare` +``` purescript +unsafeCompare :: forall a. a -> a -> Ordering +``` +The `unsafeCompare` function is mainly intended for module writers supporting native types via the FFI, and not for general comparisons. diff --git a/src/Prelude.js b/src/Prelude.js index e0b161ce..6e4d364a 100644 --- a/src/Prelude.js +++ b/src/Prelude.js @@ -172,12 +172,7 @@ exports.unsafeCompareImpl = function (lt) { }; }; -//- Bounded -------------------------------------------------------------------- - -exports.topChar = String.fromCharCode(65535); -exports.bottomChar = String.fromCharCode(0); - -//- BooleanAlgebra ------------------------------------------------------------- +//- Lattice -------------------------------------------------------------------- exports.boolOr = function (b1) { return function (b2) { @@ -191,6 +186,8 @@ exports.boolAnd = function (b1) { }; }; +//- ComplementedLattice -------------------------------------------------------- + exports.boolNot = function (b) { return !b; }; diff --git a/src/Prelude.purs b/src/Prelude.purs index 05e892ac..f7458b17 100644 --- a/src/Prelude.purs +++ b/src/Prelude.purs @@ -737,18 +737,10 @@ instance boundedInt :: Bounded Int where top = 2147483647 bottom = -2147483648 --- | Characters fall within the Unicode range. -instance boundedChar :: Bounded Char where - top = topChar - bottom = bottomChar - instance boundedFn :: (Bounded b) => Bounded (a -> b) where top _ = top bottom _ = bottom -foreign import topChar :: Char -foreign import bottomChar :: Char - -- | The `BoundedOrd` type class represents totally ordered finite data types. -- | -- | Instances should satisfy the following law in addition to the `Ord` laws: @@ -760,7 +752,6 @@ instance boundedOrdBoolean :: BoundedOrd Boolean where instance boundedOrdUnit :: BoundedOrd Unit where instance boundedOrdOrdering :: BoundedOrd Ordering where instance boundedOrdInt :: BoundedOrd Int where -instance boundedOrdChar :: BoundedOrd Char where -- | The `BooleanAlgebra` type class represents types that behave like boolean -- | values.