File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -7,13 +7,13 @@ module PrismsForSumTypes where
7
7
Use a Prism if you want to write code like this:
8
8
9
9
preview prismForSolidFill $ Solid Color.white
10
- -- ( Just rgba 255 255 255 1.0)
10
+ -- Just Color.white
11
11
12
12
preview prismForSolidFill NoFill
13
13
-- Nothing
14
14
15
15
review prismForSolidFill Color.white
16
- -- ( Solid rgba 255 255 255 1.0)
16
+ -- Solid Color.white
17
17
-}
18
18
19
19
{- If you want to try out examples, paste the following into the repl.
@@ -159,9 +159,7 @@ l2 = review linearFocus { color1 : Color.black
159
159
}
160
160
161
161
162
- {- ----- Constructing more specific prisms ------}
163
-
164
- -- `only` is used to check for a specific value:
162
+ {- ----- Use `only` to focus on specific values ------}
165
163
166
164
whiteToBlackFocus :: Prism' Fill Unit
167
165
whiteToBlackFocus = only fillWhiteToBlack
@@ -181,6 +179,8 @@ o3 = is whiteToBlackFocus fillRadial :: Boolean
181
179
-- Note that `only` requires `Fill` to implement `Eq`.
182
180
-- It's the only prism constructor that does.
183
181
182
+ {- ----- Use `nearly` to focus on a sub-case ------}
183
+
184
184
185
185
-- `nearly` is typically used to look for a specific case (like other
186
186
-- prisms), but also accepts only values that are close to some target
You can’t perform that action at this time.
0 commit comments