Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tutorial is out of date #11

Open
drake-mer opened this issue Jul 29, 2018 · 7 comments
Open

Tutorial is out of date #11

drake-mer opened this issue Jul 29, 2018 · 7 comments

Comments

@drake-mer
Copy link

Tutorial on parsec is out of date, doesn't work with current latest Haskell/GHC distribution for various reason. I would be glad to submit a pull request to fix it.

@JakeWheat
Copy link
Owner

Thanks for the heads up, a pull request would be great.

@DavidAntliff
Copy link

One item in particular - the many combinator is not in scope at the point where the tutorial uses it (many1 is though). I'm not sure what the workaround is yet.

@elijahbal are you still planning to submit a PR to update the tutorial? It would be a lot more useful to people if it worked with the latest GHC.

@DavidAntliff
Copy link

DavidAntliff commented Dec 4, 2018

Apparently the workaround is to add > import Control.Applicative (many) to GettingStarted.lhs.

EDIT: > import Text.ParserCombinators.ReadP (many) might be better - I don't know enough to decide.

Also, I had to add > import Control.Monad (void) to get void, mentioned in section 3.3.

@drake-mer
Copy link
Author

@DavidAntliff I don't really have the time anymore to focus on it but if really you are encouraging me I can delve into it. I'm with you in any case.

@DavidAntliff
Copy link

@elijahbal It's ok, I've been finding the issues as I go and working out how to get past them. I don't need anything, had just wondered if maybe a PR was still on its way - no problem if not.

@FranklinChen
Copy link

Also, adding a Cabal file for a full build would be nice.

@JakeWheat
Copy link
Owner

Hi All,

I did a quick check with ghc 8.6.5, and did some small fixes. If you find any issues, please say which exact line fails for you (and provide a patch or the fix in a comment or bug report), then I can fix it.
I didn't manage to find where either 'many' or 'void' were missing, but maybe these were added to the exports in updates to the parsec package after you looked at the tutorial?

I also added a cabal file, so now you can do something like 'cabal new-repl'. It works, but it's not quite right yet - you get some warnings to ignore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants