File tree 3 files changed +23
-8
lines changed
3 files changed +23
-8
lines changed Original file line number Diff line number Diff line change @@ -836,6 +836,12 @@ _left-associative / precedence 4_
836
836
837
837
Test whether one value is _ non-strictly greater than_ another.
838
838
839
+ #### ` unsafeCompare `
840
+
841
+ ``` purescript
842
+ unsafeCompare :: forall a. a -> a -> Ordering
843
+ ```
844
+
839
845
#### ` Bounded `
840
846
841
847
``` purescript
@@ -860,6 +866,7 @@ instance boundedBoolean :: Bounded Boolean
860
866
instance boundedUnit :: Bounded Unit
861
867
instance boundedOrdering :: Bounded Ordering
862
868
instance boundedInt :: Bounded Int
869
+ instance boundedChar :: Bounded Char
863
870
instance boundedFn :: (Bounded b) => Bounded (a -> b)
864
871
```
865
872
@@ -881,6 +888,7 @@ instance boundedOrdBoolean :: BoundedOrd Boolean
881
888
instance boundedOrdUnit :: BoundedOrd Unit
882
889
instance boundedOrdOrdering :: BoundedOrd Ordering
883
890
instance boundedOrdInt :: BoundedOrd Int
891
+ instance boundedOrdChar :: BoundedOrd Char
884
892
```
885
893
886
894
#### ` BooleanAlgebra `
@@ -975,9 +983,4 @@ instance showArray :: (Show a) => Show (Array a)
975
983
instance showOrdering :: Show Ordering
976
984
```
977
985
978
- #### ` unsafeCompare `
979
986
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.
Original file line number Diff line number Diff line change @@ -172,7 +172,12 @@ exports.unsafeCompareImpl = function (lt) {
172
172
} ;
173
173
} ;
174
174
175
- //- Lattice --------------------------------------------------------------------
175
+ //- Bounded --------------------------------------------------------------------
176
+
177
+ exports . topChar = String . fromCharCode ( 65535 ) ;
178
+ exports . bottomChar = String . fromCharCode ( 0 ) ;
179
+
180
+ //- BooleanAlgebra -------------------------------------------------------------
176
181
177
182
exports . boolOr = function ( b1 ) {
178
183
return function ( b2 ) {
@@ -186,8 +191,6 @@ exports.boolAnd = function (b1) {
186
191
} ;
187
192
} ;
188
193
189
- //- ComplementedLattice --------------------------------------------------------
190
-
191
194
exports . boolNot = function ( b ) {
192
195
return ! b ;
193
196
} ;
Original file line number Diff line number Diff line change @@ -737,10 +737,18 @@ instance boundedInt :: Bounded Int where
737
737
top = 2147483647
738
738
bottom = -2147483648
739
739
740
+ -- | Characters fall within the Unicode range.
741
+ instance boundedChar :: Bounded Char where
742
+ top = topChar
743
+ bottom = bottomChar
744
+
740
745
instance boundedFn :: (Bounded b ) => Bounded (a -> b ) where
741
746
top _ = top
742
747
bottom _ = bottom
743
748
749
+ foreign import topChar :: Char
750
+ foreign import bottomChar :: Char
751
+
744
752
-- | The `BoundedOrd` type class represents totally ordered finite data types.
745
753
-- |
746
754
-- | Instances should satisfy the following law in addition to the `Ord` laws:
@@ -752,6 +760,7 @@ instance boundedOrdBoolean :: BoundedOrd Boolean where
752
760
instance boundedOrdUnit :: BoundedOrd Unit where
753
761
instance boundedOrdOrdering :: BoundedOrd Ordering where
754
762
instance boundedOrdInt :: BoundedOrd Int where
763
+ instance boundedOrdChar :: BoundedOrd Char where
755
764
756
765
-- | The `BooleanAlgebra` type class represents types that behave like boolean
757
766
-- | values.
You can’t perform that action at this time.
0 commit comments