[Haskell-cafe] Parsec beginners problem

Jim Burton jim at sdf-eu.org
Fri Apr 27 10:31:18 EDT 2007




Jim Burton wrote:
> 
> 
> 
> Dougal Stanton wrote:
>> 
>> This may be relevant or not, but I thought morse required a delimiting
>> character between letters, because otherwise the message was
>> ambiguous? I seem to recall somewhere that Parsec didn't handle
>> non-deterministic parsings very well (or at all).
>> 
>> D.
>> _______________________________________________
>> Haskell-Cafe mailing list
>> Haskell-Cafe at haskell.org
>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>> 
>> 
> 
> You could be right about delimiters, but handling the ambiguous instances
> is the challenge in this case, which is a Ruby Quiz
> [http://www.rubyquiz.com/quiz121.html] - I thought it would be a good use
> for Parsec, and the user guide talks about try..<|> as the tool for it, as
> in 
> 
> testOr2 =   try (string "(a)")
>         <|> string "(b)"
> 
> 

After posting I realised the difference between parsing "(a)" <|> "(b)" and
parsing "a" <|> "aa" ... so Parsec doesn't do the latter well or at all?

-- 
View this message in context: http://www.nabble.com/Parsec-beginners-problem-tf3657821.html#a10220156
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.



More information about the Haskell-Cafe mailing list