@@ -111,9 +111,6 @@ asTypeOf x _ = x
111111otherwise :: Boolean
112112otherwise = true
113113
114- infixr 9 >>>
115- infixr 9 <<<
116-
117114-- | A `Semigroupoid` is similar to a [`Category`](#category) but does not
118115-- | require an identity element `id`, just composable morphisms.
119116-- |
@@ -129,6 +126,10 @@ class Semigroupoid a where
129126instance semigroupoidFn :: Semigroupoid (-> ) where
130127 compose f g x = f (g x)
131128
129+ infixr 9 >>>
130+ infixr 9 <<<
131+
132+ -- | `(<<<)` is an alias for `compose`.
132133(<<<) :: forall a b c d . (Semigroupoid a ) => a c d -> a b c -> a b d
133134(<<<) = compose
134135
@@ -150,9 +151,6 @@ class (Semigroupoid a) <= Category a where
150151instance categoryFn :: Category (-> ) where
151152 id x = x
152153
153- infixl 4 <$>
154- infixl 1 <#>
155-
156154-- | A `Functor` is a type constructor which supports a mapping operation
157155-- | `(<$>)`.
158156-- |
@@ -175,6 +173,10 @@ instance functorArray :: Functor Array where
175173
176174foreign import arrayMap :: forall a b . (a -> b ) -> Array a -> Array b
177175
176+ infixl 4 <$>
177+ infixl 1 <#>
178+
179+ -- | `(<$>)` is an alias for `map`
178180(<$>) :: forall f a b . (Functor f ) => (a -> b ) -> f a -> f b
179181(<$>) = map
180182
@@ -201,8 +203,6 @@ foreign import arrayMap :: forall a b. (a -> b) -> Array a -> Array b
201203void :: forall f a . (Functor f ) => f a -> f Unit
202204void fa = const unit <$> fa
203205
204- infixl 4 <*>
205-
206206-- | The `Apply` class provides the `(<*>)` which is used to apply a function
207207-- | to an argument under a type constructor.
208208-- |
@@ -234,6 +234,9 @@ instance applyFn :: Apply ((->) r) where
234234instance applyArray :: Apply Array where
235235 apply = ap
236236
237+ infixl 4 <*>
238+
239+ -- | `(<*>)` is an alias for `apply`.
237240(<*>) :: forall f a b . (Apply f ) => f (a -> b ) -> f a -> f b
238241(<*>) = apply
239242
@@ -283,8 +286,6 @@ return = pure
283286liftA1 :: forall f a b . (Applicative f ) => (a -> b ) -> f a -> f b
284287liftA1 f a = pure f <*> a
285288
286- infixl 1 >>=
287-
288289-- | The `Bind` type class extends the [`Apply`](#apply) type class with a
289290-- | "bind" operation `(>>=)` which composes computations in sequence, using
290291-- | the return value of one computation to determine the next computation.
@@ -322,6 +323,9 @@ instance bindArray :: Bind Array where
322323
323324foreign import arrayBind :: forall a b . Array a -> (a -> Array b ) -> Array b
324325
326+ infixl 1 >>=
327+
328+ -- | `(>>=)` is an alias for `bind`.
325329(>>=) :: forall m a b . (Bind m ) => m a -> (a -> m b ) -> m b
326330(>>=) = bind
327331
@@ -373,9 +377,6 @@ ap f a = do
373377 a' <- a
374378 return (f' a')
375379
376- infixr 5 <>
377- infixr 5 ++
378-
379380-- | The `Semigroup` type class identifies an associative operation on a type.
380381-- |
381382-- | Instances are required to satisfy the following law:
@@ -387,11 +388,14 @@ infixr 5 ++
387388class Semigroup a where
388389 append :: a -> a -> a
389390
391+ infixr 5 <>
392+ infixr 5 ++
393+
390394-- | `(<>)` is an alias for `append`.
391395(<>) :: forall s . (Semigroup s ) => s -> s -> s
392396(<>) = append
393397
394- -- | `(++)` is an alias for `append`.
398+ -- | `(++)` is an alternative alias for `append`.
395399(++) :: forall s . (Semigroup s ) => s -> s -> s
396400(++) = append
397401
@@ -415,9 +419,6 @@ instance semigroupArray :: Semigroup (Array a) where
415419foreign import concatString :: String -> String -> String
416420foreign import concatArray :: forall a . Array a -> Array a -> Array a
417421
418- infixl 6 +
419- infixl 7 *
420-
421422-- | The `Semiring` class is for types that support an addition and
422423-- | multiplication operation.
423424-- |
@@ -458,6 +459,9 @@ instance semiringUnit :: Semiring Unit where
458459 mul _ _ = unit
459460 one = unit
460461
462+ infixl 6 +
463+ infixl 7 *
464+
461465-- | `(+)` is an alias for `add`.
462466(+) :: forall a . (Semiring a ) => a -> a -> a
463467(+) = add
@@ -471,8 +475,6 @@ foreign import intMul :: Int -> Int -> Int
471475foreign import numAdd :: Number -> Number -> Number
472476foreign import numMul :: Number -> Number -> Number
473477
474- infixl 6 -
475-
476478-- | The `Ring` class is for types that support addition, multiplication,
477479-- | and subtraction operations.
478480-- |
@@ -492,6 +494,8 @@ instance ringNumber :: Ring Number where
492494instance ringUnit :: Ring Unit where
493495 sub _ _ = unit
494496
497+ infixl 6 -
498+
495499-- | `(-)` is an alias for `sub`.
496500(-) :: forall a . (Ring a ) => a -> a -> a
497501(-) = sub
@@ -503,8 +507,6 @@ negate a = zero - a
503507foreign import intSub :: Int -> Int -> Int
504508foreign import numSub :: Number -> Number -> Number
505509
506- infixl 7 /
507-
508510-- | The `ModuloSemiring` class is for types that support addition,
509511-- | multiplication, division, and modulo (division remainder) operations.
510512-- |
@@ -528,6 +530,8 @@ instance moduloSemiringUnit :: ModuloSemiring Unit where
528530 div _ _ = unit
529531 mod _ _ = unit
530532
533+ infixl 7 /
534+
531535-- | `(/)` is an alias for `div`.
532536(/) :: forall a . (ModuloSemiring a ) => a -> a -> a
533537(/) = div
@@ -561,9 +565,6 @@ class (DivisionRing a) <= Num a
561565instance numNumber :: Num Number
562566instance numUnit :: Num Unit
563567
564- infix 4 ==
565- infix 4 /=
566-
567568-- | The `Eq` type class represents types which support decidable equality.
568569-- |
569570-- | `Eq` instances should satisfy the following laws:
@@ -574,10 +575,15 @@ infix 4 /=
574575class Eq a where
575576 eq :: a -> a -> Boolean
576577
577- -- | `(==)` is an alias for `eq`.
578+ infix 4 ==
579+ infix 4 /=
580+
581+ -- | `(==)` is an alias for `eq`. Tests whether one value is equal to another.
578582(==) :: forall a . (Eq a ) => a -> a -> Boolean
579583(==) = eq
580584
585+ -- | `(/=)` tests whether one value is _not equal_ to another. Shorthand for
586+ -- | `not (x == y)`.
581587(/=) :: forall a . (Eq a ) => a -> a -> Boolean
582588(/=) x y = not (x == y)
583589
@@ -793,16 +799,16 @@ instance booleanAlgebraFn :: (BooleanAlgebra b) => BooleanAlgebra (a -> b) where
793799 disj fx fy a = fx a `disj` fy a
794800 not fx a = not (fx a)
795801
796- infixr 2 ||
797802infixr 3 &&
803+ infixr 2 ||
798804
799- -- | The `conj` operator.
800- (||) :: forall a . (BooleanAlgebra a ) => a -> a -> a
801- (||) = conj
802-
803- -- | The `disj` operator.
805+ -- | `(&&)` is an alias for `conj`.
804806(&&) :: forall a . (BooleanAlgebra a ) => a -> a -> a
805- (&&) = disj
807+ (&&) = conj
808+
809+ -- | `(||)` is an alias for `disj`.
810+ (||) :: forall a . (BooleanAlgebra a ) => a -> a -> a
811+ (||) = disj
806812
807813foreign import boolOr :: Boolean -> Boolean -> Boolean
808814foreign import boolAnd :: Boolean -> Boolean -> Boolean
0 commit comments