Skip to content

Commit 0ea05f1

Browse files
authored
Merge pull request #192 from LiamGoodacre/fix/minor-docs
Minor doc clean up
2 parents dc10694 + fb06c40 commit 0ea05f1

File tree

12 files changed

+39
-14
lines changed

12 files changed

+39
-14
lines changed

src/Data/Monoid.purs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ import Type.Data.RowList (RLProxy(..))
2222
-- | A `Monoid` is a `Semigroup` with a value `mempty`, which is both a
2323
-- | left and right unit for the associative operation `<>`:
2424
-- |
25-
-- | ```
26-
-- | forall x. mempty <> x = x <> mempty = x
27-
-- | ```
25+
-- | - Left unit: `(mempty <> x) = x`
26+
-- | - Right unit: `(x <> mempty) = x`
2827
-- |
2928
-- | `Monoid`s are commonly used as the result of fold operations, where
3029
-- | `<>` is used to combine individual results, and `mempty` gives the result

src/Data/Monoid/Additive.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Data.Ord (class Ord1)
99
-- |
1010
-- | ``` purescript
1111
-- | Additive x <> Additive y == Additive (x + y)
12-
-- | mempty :: Additive _ == Additive zero
12+
-- | (mempty :: Additive _) == Additive zero
1313
-- | ```
1414
newtype Additive a = Additive a
1515

src/Data/Monoid/Conj.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Data.Ord (class Ord1)
1010
-- |
1111
-- | ``` purescript
1212
-- | Conj x <> Conj y == Conj (x && y)
13-
-- | mempty :: Conj _ == Conj tt
13+
-- | (mempty :: Conj _) == Conj tt
1414
-- | ```
1515
newtype Conj a = Conj a
1616

src/Data/Monoid/Disj.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Data.Ord (class Ord1)
1010
-- |
1111
-- | ``` purescript
1212
-- | Disj x <> Disj y == Disj (x || y)
13-
-- | mempty :: Disj _ == Disj bottom
13+
-- | (mempty :: Disj _) == Disj bottom
1414
-- | ```
1515
newtype Disj a = Disj a
1616

src/Data/Monoid/Dual.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Data.Ord (class Ord1)
99
-- |
1010
-- | ``` purescript
1111
-- | Dual x <> Dual y == Dual (y <> x)
12-
-- | mempty :: Dual _ == Dual mempty
12+
-- | (mempty :: Dual _) == Dual mempty
1313
-- | ```
1414
newtype Dual a = Dual a
1515

src/Data/Monoid/Endo.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Prelude
99
-- |
1010
-- | ``` purescript
1111
-- | Endo f <> Endo g == Endo (f <<< g)
12-
-- | mempty :: Endo _ == Endo identity
12+
-- | (mempty :: Endo _) == Endo identity
1313
-- | ```
1414
newtype Endo c a = Endo (c a a)
1515

src/Data/Monoid/Multiplicative.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Data.Ord (class Ord1)
99
-- |
1010
-- | ``` purescript
1111
-- | Multiplicative x <> Multiplicative y == Multiplicative (x * y)
12-
-- | mempty :: Multiplicative _ == Multiplicative one
12+
-- | (mempty :: Multiplicative _) == Multiplicative one
1313
-- | ```
1414
newtype Multiplicative a = Multiplicative a
1515

src/Data/NaturalTransformation.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module Data.NaturalTransformation where
33
-- | A type for natural transformations.
44
-- |
55
-- | A natural transformation is a mapping between type constructors of kind
6-
-- | `* -> *` where the mapping operation has no ability to manipulate the
6+
-- | `Type -> Type` where the mapping operation has no ability to manipulate the
77
-- | inner values.
88
-- |
99
-- | An example of this is the `fromFoldable` function provided in
@@ -12,7 +12,7 @@ module Data.NaturalTransformation where
1212
-- |
1313
-- | The definition of a natural transformation in category theory states that
1414
-- | `f` and `g` should be functors, but the `Functor` constraint is not
15-
-- | enforced here; that the types are of kind `* -> *` is enough for our
15+
-- | enforced here; that the types are of kind `Type -> Type` is enough for our
1616
-- | purposes.
1717
type NaturalTransformation f g = forall a. f a -> g a
1818

src/Data/Unit.purs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import Data.Show (class Show)
66
-- | values with no computational content.
77
-- |
88
-- | `Unit` is often used, wrapped in a monadic type constructor, as the
9-
-- | return type of a computation where only
10-
-- | the _effects_ are important.
9+
-- | return type of a computation where only the _effects_ are important.
1110
foreign import data Unit :: Type
1211

1312
-- | `unit` is the sole inhabitant of the `Unit` type.

src/Data/Void.purs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ newtype Void = Void Void
1212
instance showVoid :: Show Void where
1313
show = absurd
1414

15+
-- | Eliminator for the `Void` type.
16+
-- | Useful for stating that some code branch is impossible because you've
17+
-- | "acquired" a value of type `Void` (which you can't).
18+
-- |
19+
-- | ```purescript
20+
-- | rightOnly :: forall t . Either Void t -> t
21+
-- | rightOnly (Left v) = absurd v
22+
-- | rightOnly (Right t) = t
23+
-- | ```
1524
absurd :: forall a. Void -> a
1625
absurd a = spin a
1726
where

0 commit comments

Comments
 (0)