@@ -90,11 +90,11 @@ Our next routes require extracting an integer `PostId`.
9090``` purescript
9191post :: Match MyRoute
9292post =
93- Post <$> lit "posts" *> int
93+ Post <$> ( lit "posts" *> int)
9494
9595postEdit :: Match MyRoute
9696postEdit =
97- PostEdit <$> lit "posts" *> int <* lit "edit"
97+ PostEdit <$> ( lit "posts" *> int <* lit "edit")
9898```
9999
100100Note the use of the ` *> ` and ` <* ` operators. These let us direct the focus of
@@ -107,7 +107,7 @@ And now finally, we need to extract multiple segments for `PostBrowse`.
107107``` purescript
108108postBrowse :: Match MyRoute
109109postBrowse =
110- PostBrowse <$> lit "posts" *> str <*> str
110+ PostBrowse <$> ( lit "posts" *> str <*> str)
111111```
112112
113113The ` <*> ` combinator has arrows on both sides because we want both values.
@@ -144,9 +144,9 @@ We can also go ahead and inline our parsers.
144144myRoute :: Match MyRoute
145145myRoute = oneOf
146146 [ PostIndex <$ lit "posts"
147- , Post <$> lit "posts" *> int
148- , PostEdit <$> lit "posts" *> int <* lit "edit"
149- , PostBrowse <$> lit "posts" *> str <*> str
147+ , Post <$> ( lit "posts" *> int)
148+ , PostEdit <$> ( lit "posts" *> int <* lit "edit")
149+ , PostBrowse <$> ( lit "posts" *> str <*> str)
150150 ]
151151```
152152
@@ -161,8 +161,8 @@ myRoute =
161161 lit "posts" *> oneOf
162162 [ pure PostIndex
163163 , Post <$> int
164- , PostEdit <$> int <* lit "edit"
165- , PostBrowse <$> str <*> str
164+ , PostEdit <$> ( int <* lit "edit")
165+ , PostBrowse <$> ( str <*> str)
166166 ]
167167```
168168
@@ -179,9 +179,9 @@ myRoute :: Match MyRoute
179179myRoute =
180180 lit "posts" *> oneOf
181181 [ PostIndex <$ end
182- , Post <$> int <* end
183- , PostEdit <$> int <* lit "edit" <* end
184- , PostBrowse <$> str <*> str <* end
182+ , Post <$> ( int <* end)
183+ , PostEdit <$> ( int <* lit "edit" <* end)
184+ , PostBrowse <$> ( str <*> str <* end)
185185 ]
186186```
187187
@@ -193,9 +193,9 @@ the routes followed by an `end`, so we would still have to rearrange them.
193193myRoute :: Match MyRoute
194194myRoute =
195195 lit "posts" *> oneOf
196- [ PostEdit <$> int <* lit "edit"
196+ [ PostEdit <$> ( int <* lit "edit")
197197 , Post <$> int
198- , PostBrowse <$> str <*> str
198+ , PostBrowse <$> ( str <*> str)
199199 , pure PostIndex
200200 ] <* end
201201```
@@ -211,9 +211,9 @@ with the `root` combinator.
211211myRoute :: Match MyRoute
212212myRoute =
213213 root *> lit "posts" *> oneOf
214- [ PostEdit <$> int <* lit "edit"
214+ [ PostEdit <$> ( int <* lit "edit")
215215 , Post <$> int
216- , PostBrowse <$> str <*> str
216+ , PostBrowse <$> ( str <*> str)
217217 , pure PostIndex
218218 ] <* end
219219```
0 commit comments