Close#62.
Apart from some refactoring, the following important changes were
introduced:
* ‘ParseError’ is now a monoid.
* Added functions ‘addErrorMessages’ and ‘newErrorMessages’.
Now it's impossible to create ‘SourcePos’ with non-positive line number
or column number. Unfortunately we cannot use ‘Numeric.Natural’ because
we need to support older versions of ‘base’.
It seems like there won't be official Megaparsec tutorial for a
while. Also, the text is now written in such manner so it can be used on
Megaparsec site without any additional corrections.
This commit mainly adds missing "a", "an" or "the", whenever something is used in singular, for example:
- user will see the label in error message
+ the user will see the label in the error message
In some cases, I've removed a word, for example "module" after `Text.Megaparsec.Char`, since it's clear you're talking about a module (otherwise "the" before the module name would be necessary).
This should provide a more fluid reading experience.
Indented text returned by ‘showMessages’ may be undesirable, but we
cannot add indentation outside of the function (edge case: strings
including newline are displayed in the messages).
Closes#56.
In particular, file name and textual position are represented like this:
filename.hs:5:6:
error message
This format should be more conventional, so various tools will be able
to parse it and provide some support (for example, Emacs can work with
this format).
‘Text.Megaparsec’ and ‘Text.Megaparsec.Prim’ do not export these data
types and their constructors anymore. These data types are rather
low-level implementation detail that should not be visible to
end-user. They are also subject to certain changes in future.
This patch introduces compatibility to base-4.7.0.x. It was tested
on Win 8.1 x86_64, using GHC 7.8.4. It mainly consists of a bunch
of #if !MIN_VERSION(4,8,0) ... #endif additions and a lower bound
on base in the cabal file as well as a general introduction of the
CPP extension via default-extensions.
It also removes a potential error source in tests/Util.hs, since
the backslash in /=\ can lead to strange quirks on certain systems
(backslash and newline only separated by whitespace).
Other, squashed commits:
- Remove 'recent version of base' from Readme
- Change necessary version of GHC
‘Text.Megaparsec.Prim’ cannot be considered portable since it uses
multi-parameter type classes and functional dependencies.
Other modules that depend on these non-portable features from
‘Text.Megaparsec.Prim’ should be considered non-portable too.