on master help sign in
Stop doing an extra `getPosition` call

Probably not a big deal. Possibly the (>>=) usage is not as good. Unclear. The main thing is that I find the new code less surprising

commiteb5da5e6a66f5df410203f81323014afee3fc8d0 authorEvan Czaplicki <evancz@users.noreply.github.com> dateWed 20 Dec 2017, 16:32 (9 years ago) parent2d24732
1 file changed+6−3
src/Parse/Pattern.hs+6−3
src/Parse/Pattern.hs+6−3
@@ -232,11 +232,14 @@ cons tl@(A.At (R.Region _ end) _) hd@(A.At (R.Region start _) _) =
232232exprTerm :: SParser Src.Pattern
233233exprTerm =
234234 oneOf
235− [ do start <- getPosition
235+ [
236+ do start <- getPosition
236237 pair <- Var.foreignUpper
237238 exprTermHelp start pair []
238−
239− , (,,) <$> term <*> getPosition <*> whitespace
239+ ,
240+ do t@(A.At (R.Region _ end) _) <- term
241+ pos <- whitespace
242+ return (t, end, pos)
240243 ]
241244
242245