haskell / haskell/parsec

the name of `notFollowedBy` is not consistent with the semantics of the other parsers

Open
#92 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
892
Forks
99
PR merge metrics
No merged PRs in 30d

Description

Just a small thing if you want, i'm pointing this out while approaching Parsec, before getting used to this.

Usually a parser's name refers to the current parser input. `char 'a'` will parse `'a'` and so on.

If we read `notFollowedBy` with the same semantics, a parser like `notFollowedBy '.'` should correctly parse `"."` because `"."` _is not followed by a dot_. It should fail for "a.", instead.

In this sense a parser called `notFollowedBy` should probably get two parsers as arguments, like `manyTill` etcetera. I find that the current semantic of `notFollowedBy` is closer to a simple `not`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.