Skip to content

Topic/remove plus - #20

Merged
srghma-old merged 2 commits into
purescript-contrib:masterfrom
HuwCampbell:topic/remove-plus
Apr 9, 2021
Merged

Topic/remove plus#20
srghma-old merged 2 commits into
purescript-contrib:masterfrom
HuwCampbell:topic/remove-plus

Conversation

@HuwCampbell

@HuwCampbellHuwCampbell commented Apr 3, 2020

Copy link
Copy Markdown
Contributor

Nice port.

Purescript's class hierarchy is more granular than Haskell's; and has in its prelude an Alt preceding Alternative.

In the Haskell version, a parser is essentially a free Alternative, with NilP None being empty, and NilP . Just being pure. But we don't actually need the empty at all though; and really its existence just means there are places where we can't give meaningful error messages.

Similarly, the empty on ReadM just gives no error message, which is pretty awful.

I'm not sure how much you plan on deviating from our version; nor whether you are up for breaking changes. I mostly did this to know I may be able to in the future in the Haskell version.

So feel free to not merge this (and I would probably suggest against it until purescript/purescript-maybe#45 is addressed).

Fix up tests, we can't use guard anymore, but that's ok, as it doesn't
give an error message anyway.
@srghma-old
srghma-old merged commit 2c62289 into purescript-contrib:masterApr 9, 2021
@HuwCampbell

Copy link
Copy Markdown
ContributorAuthor

Cool.

After purescript/purescript-maybe#45 it looks like the little version I forked inline can probably be removed.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@HuwCampbell