While you're hacking around on parsec a nice improvement would be to relax the type on the language generators in Text.ParserCombinators.Parsec.Language. (This one could be done without so drastic a change as bumping from 3 to 4):<div>
<br></div><div>They can all be instantiated for Monad m => GenLanguageDef String s m instead of LanguageDef, this would greatly extend their usability.</div><div><br></div><div>You could even go a little farther and relax them so they can work over Bytestrings, etc.</div>
<div><br></div><div>I for one always feel a little twinge when I'm forced to copy and paste them and change the signature just because I'm working in a parser that provides state, uses _any_ base monad, or consumes some other Char source.</div>
<div><br></div><div>-Edward Kmett<br><div><div><br><div class="gmail_quote">On Fri, Jan 28, 2011 at 8:57 AM, Christian Maeder <span dir="ltr"><<a href="mailto:Christian.Maeder@dfki.de">Christian.Maeder@dfki.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">Am 27.01.2011 07:16, schrieb Kazu Yamamoto (山本和彦):<br>
</div><div class="im">> Hello,<br>
><br>
> I'm using parsec3 with the applicative style. Since the functions in<br>
> Control.Applicative and parsec3 conflicts, I need to use the "hiding"<br>
> keyword as follows:<br>
><br>
> import Control.Applicative hiding (many,optional,(<|>))<br>
> import Text.Parsec<br>
><br>
> This is inconvenient for me. I would like to use them as follows:<br>
><br>
> import Control.Applicative<br>
> import Text.Parsec<br>
><br>
> Christian, the maintainer of parsec3, told me that it is possible to<br>
> use the functions of Control.Applicative in parsec3 instead of<br>
> implementing its own functions. But (<|>) of parsec3 is "infixr 1"<br>
> while that of Control.Applicative is "infixl 3". This may be an<br>
> issue.<br>
><br>
> Any ideas to solve this issue?<br>
<br>
</div>If parsec is not changed I could create a parsec4 package where the<br>
conflicting functions are removed from Text.Parsec.<br>
<br>
This will break code that uses "optional" from Text.Parsec. Is there a<br>
need for a renaming of Text.Parsec.Combinator.optional, like "voidOptional"?<br>
<br>
Such a function would be better placed inside Control.Applicative though:<br>
<br>
voidOptional v = const () <$> v <|> pure ()<br>
<br>
or<br>
<br>
voidOptional = void . optional<br>
<br>
<br>
using the new Control.Monad.void.<br>
<font color="#888888"><br>
C.<br>
</font><div><div></div><div class="h5"><br>
><br>
> --Kazu<br>
<br>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/libraries" target="_blank">http://www.haskell.org/mailman/listinfo/libraries</a><br>
</div></div></blockquote></div><br></div></div></div>