Skip to content

Commit

Permalink
Revise comments
Browse files Browse the repository at this point in the history
  • Loading branch information
snowleopard committed May 9, 2019
1 parent 2cf64be commit 4a5a24e
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/Control/Selective.hs
Original file line number Diff line number Diff line change
Expand Up @@ -452,11 +452,14 @@ selectAlt x y = failIfLeft x <|> selectA x y
This has two issues:
1) It's unclear if a generic 'failIfLeft' if possible, although most actual
instances should be able to implement it.
1) A generic 'failIfLeft' if not possible, although many actual instances should
be able to implement it.
2) More importantly, this requires duplication of work: if we fail becauase we
happened to parse a 'Right' value in the first parser, then we need to rerun
it again, obtain a 'Left', and then execute the second parser.
2) More importantly, this requires duplication of work: if we failed becauase we
happened to parse a 'Left' value in the first parser, then we need to rerun
it, obtain a 'Left' once again, and then execute the second parser. Again, a
specific instance may be able to cache the result and reuse it without
duplicating any work, but this does not seem to be possible to achieve
generically for any Alternative.
-}
-}

0 comments on commit 4a5a24e

Please sign in to comment.