@@ -65,7 +65,6 @@ fillRadial :: Fill
6565fillRadial = RadialGradient Color .white Color .black $ Point 1.0 3.4
6666
6767
68-
6968 {- ----- Making prisms with Maybe and `prism'` ------}
7069
7170-- `prism'` (note the apostrophe) takes two functions. One is a data
@@ -78,7 +77,7 @@ solidFocus = prism' constructor focus
7877 constructor = Solid
7978 focus fill = case fill of
8079 Solid color -> Just color
81- _ -> Nothing
80+ otherCases -> Nothing
8281
8382-- In real life, you might abbreviate the above to this:
8483
@@ -131,9 +130,6 @@ type LinearInterchange =
131130 , percent :: Percent
132131 }
133132
134- -- (In real life, you probably wouldn't have to give such a record a
135- -- type alias.)
136-
137133-- When making a prism with `prism` (no apostrophe), the "focus"
138134-- function returns either the selected value (as a `Right`) or the
139135-- entire argument (as a `Left`).
@@ -146,10 +142,11 @@ linearFocus = prism constructor focus
146142 focus = case _ of
147143 LinearGradient color1 color2 percent ->
148144 Right {color1, color2, percent}
149- otherFill ->
150- Left otherFill
145+ otherCases ->
146+ Left otherCases
151147
152- -- Even though made differently, this `linearFocus` is used the same way:
148+ -- Even though made differently than `solidFocus`, `linearFocus` is
149+ -- used the same way:
153150
154151l1 :: String
155152l1 = preview linearFocus fillBlackToWhite # maybe " !" showRecord
0 commit comments