Finding way around libraries (was parsec reorganization)

On Wed, Mar 30, 2016 at 10:06 PM, Joe Hillenbrand
Parsec isn't as maintained as Megaparsec https://mrkkrp.github.io/megaparsec/.
I recommend checking out the tutorials here https://mrkkrp.github.io/megaparsec/tutorials.html.
So under the advice to use megaparsec instead of parsec, I tried the examples here: https://mrkkrp.github.io/megaparsec/tutorials/fun-with-the-recovery-feature.... Got a page full of errors starting: fpl.hs:42:20: Not in scope: ‘<$>’ … Perhaps you meant one of these: On a hunch I changed import Control.Applicative (empty) to import Control.Applicative and then it started working. I can only expect that if megaparsec's own official tutorials are thus out of sync with current haskell, then parsec's will be even more so. Also I find no megaparsec on hoogle/hayoo So how does one go about handling the dilemma: - megaparsec : in development but undocumented on hayoo/hoohle - parsec : documented but bitrotten What/how do haskell pros go about handling such Thanks Rusi

On Wed, Apr 13, 2016 at 05:12:32PM +0530, Rustom Mody wrote:
I tried the examples here:
https://mrkkrp.github.io/megaparsec/tutorials/fun-with-the-recovery-feature....
Got a page full of errors starting:
fpl.hs:42:20: Not in scope: ‘<$>’ … Perhaps you meant one of these:
On a hunch I changed import Control.Applicative (empty) to import Control.Applicative
and then it started working. I can only expect that if megaparsec's own official tutorials are thus out of sync with current haskell, then parsec's will be even more so.
On the contrary, you are out of sync with current Haskell :) <$> is in the latest Prelude. Still, best practices should mandate that tutorials support earlier releases of Haskell too, to avoid these types of confusion.
Also I find no megaparsec on hoogle/hayoo
I recommend the Hoogle provided by Stackage. It searches more packages by default, including megaparsec. https://www.stackage.org/ (Alternatively, I think there is a magic incantation to make the haskell.org Hoogle search more packages, but I don't know it). Tom

On Wed, Apr 13, 2016 at 2:42 PM, Rustom Mody
On Wed, Mar 30, 2016 at 10:06 PM, Joe Hillenbrand
wrote: Parsec isn't as maintained as Megaparsec https://mrkkrp.github.io/megaparsec/.
I recommend checking out the tutorials here https://mrkkrp.github.io/megaparsec/tutorials.html.
So under the advice to use megaparsec instead of parsec, I tried the examples here: https://mrkkrp.github.io/megaparsec/tutorials/fun-with-the-recovery-feature....
Got a page full of errors starting:
fpl.hs:42:20: Not in scope: ‘<$>’ … Perhaps you meant one of these:
On a hunch I changed import Control.Applicative (empty) to import Control.Applicative
and then it started working.
This specific case is most likely due to different versions of GHC being used. Since 7.10, Prelude exports <$>. To avoid these kinds of problems, I've started including Stack script interpreter lines at the beginning of examples to encode exactly which version of GHC and other packages the example was tested with. In fact, I wrote a blog post about it last week: http://www.yesodweb.com/blog/2016/04/stackifying-the-cookbook Michael
I can only expect that if megaparsec's own official tutorials are thus out of sync with current haskell, then parsec's will be even more so.
Also I find no megaparsec on hoogle/hayoo
So how does one go about handling the dilemma: - megaparsec : in development but undocumented on hayoo/hoohle - parsec : documented but bitrotten
What/how do haskell pros go about handling such
Thanks Rusi
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
participants (3)
-
Michael Snoyman
-
Rustom Mody
-
Tom Ellis