Skip to content

Commit 4507fd8

Browse files
committed
Minor textual improvements in SumTypes example.
1 parent 7f19802 commit 4507fd8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

examples/src/PrismsForSumTypes.purs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ module PrismsForSumTypes where
77
Use a Prism if you want to write code like this:
88
99
preview prismForSolidFill $ Solid Color.white
10-
-- (Just rgba 255 255 255 1.0)
10+
-- Just Color.white
1111
1212
preview prismForSolidFill NoFill
1313
-- Nothing
1414
1515
review prismForSolidFill Color.white
16-
-- (Solid rgba 255 255 255 1.0)
16+
-- Solid Color.white
1717
-}
1818

1919
{- If you want to try out examples, paste the following into the repl.
@@ -159,9 +159,7 @@ l2 = review linearFocus { color1 : Color.black
159159
}
160160

161161

162-
{------ Constructing more specific prisms ------}
163-
164-
-- `only` is used to check for a specific value:
162+
{------ Use `only` to focus on specific values ------}
165163

166164
whiteToBlackFocus :: Prism' Fill Unit
167165
whiteToBlackFocus = only fillWhiteToBlack
@@ -181,6 +179,8 @@ o3 = is whiteToBlackFocus fillRadial :: Boolean
181179
-- Note that `only` requires `Fill` to implement `Eq`.
182180
-- It's the only prism constructor that does.
183181

182+
{------ Use `nearly` to focus on a sub-case ------}
183+
184184

185185
-- `nearly` is typically used to look for a specific case (like other
186186
-- prisms), but also accepts only values that are close to some target

0 commit comments

Comments
 (0)