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
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
166164whiteToBlackFocus :: Prism' Fill Unit
167165whiteToBlackFocus = 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
You can’t perform that action at this time.
0 commit comments