Skip to content

Commit 5bc0644

Browse files
committed
Minor improvements to function documentation
1 parent 5b31641 commit 5bc0644

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/Data/Lens/Prism.purs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
-- |
44
-- | ```purescript
55
-- | data Fill -- think of a paint program filling a shape
6-
-- | = Solid Color
7-
-- | ...
6+
-- | = NoFill
7+
-- | | Solid Color
8+
-- | | ...
89
-- | ```
910
-- |
10-
-- | A prism that focuses on `Solid` fills would be written like this:
11+
-- | A prism that focuses on `Solid` fills could be written like this:
1112
-- |
1213
-- | ```purescript
1314
-- | solidFocus :: Prism' Fill Color
@@ -31,15 +32,15 @@
3132
-- | review solidFocus Color.white == Solid Color.white
3233
-- | ```
3334
-- |
34-
-- | For more information, see `PrismsForSumTypes` in the
35+
-- | For more information, see `PrismsForSumTypes.purs` in the
3536
-- | `examples/src` directory.
3637

3738
module Data.Lens.Prism
3839
( prism, prism'
3940
, only, nearly
4041
, review
41-
, is, isn't
42-
, clonePrism, withPrism, matching
42+
, is, isn't, matching
43+
, clonePrism, withPrism
4344
, module ExportTypes
4445
) where
4546

@@ -60,20 +61,20 @@ import Data.Newtype (under)
6061
-- | produces an `Either`:
6162
-- |
6263
-- | ```purescript
63-
-- | solidFocus' :: Prism' Fill Color
64-
-- | solidFocus' = prism Solid case _ of
64+
-- | solidFocus :: Prism' Fill Color
65+
-- | solidFocus = prism Solid case _ of
6566
-- | Solid color -> Right color
6667
-- | anotherCase -> Left anotherCase
6768
-- | ```
6869
prism :: forall s t a b. (b -> t) -> (s -> Either t a) -> Prism s t a b
6970
prism to fro pab = dimap fro (either id id) (right (rmap to pab))
7071

7172
-- | Create a `Prism` from a constructor and a "focus" function that
72-
-- | produces an `Maybe`:
73+
-- | produces a `Maybe`:
7374
-- |
7475
-- | ```purescript
75-
-- | solidFocus' :: Prism' Fill Color
76-
-- | solidFocus' = prism' Solid case _ of
76+
-- | solidFocus :: Prism' Fill Color
77+
-- | solidFocus = prism' Solid case _ of
7778
-- | Solid color -> Just color
7879
-- | _ -> Nothing
7980
-- | ```
@@ -123,7 +124,6 @@ only x = nearly x (_ == x)
123124
-- | Create the "whole" corresponding to a specific "part":
124125
-- |
125126
-- | ```purescript
126-
-- | -- solidFocus is a `Prism Fill Color`
127127
-- | review solidFocus Color.white == Solid Color.white
128128
-- | ```
129129
review :: forall s t a b. Review s t a b -> b -> t
@@ -139,10 +139,10 @@ withPrism l f = case l (Market id Right) of
139139
matching :: forall s t a b. APrism s t a b -> s -> Either t a
140140
matching l = withPrism l \_ f -> f
141141

142-
--| Would `preview prism` produce a `Just`?
142+
--| Ask if `preview prism` would produce a `Just`.
143143
is :: forall s t a b r. HeytingAlgebra r => APrism s t a b -> s -> r
144144
is l = either (const ff) (const tt) <<< matching l
145145

146-
--| Would `preview prism` produce a `Nothing`?
146+
--| Ask if `preview prism` would produce a `Nothing`.
147147
isn't :: forall s t a b r. HeytingAlgebra r => APrism s t a b -> s -> r
148148
isn't l = not <<< is l

0 commit comments

Comments
 (0)