[Haskell-cafe] How to make Prelude.read: no parse more verbose ...

Jeff Polakow jeff.polakow at db.com
Wed Dec 19 15:28:27 EST 2007


Hello,

  You can also just use reads which returns a list of (partial) parses. 

-Jeff

haskell-cafe-bounces at haskell.org wrote on 12/19/2007 03:17:39 PM:

> Hi
> 
> > > Well, how do I compile a Haskell program in such a way, that I
> > > get a useful error message from read? I mean, like the
> > > filename/linenumber of the calling expression for starters.
> 
> I use the Safe library to do this sort of stuff:
> 
> http://www-users.cs.york.ac.uk/~ndm/safe/
> 
> You can call readMay to get a maybe result, or readNote which gives an
> augmented error message on a crash. You can of course combine this
> with the CPP trick:
> 
> #define read readNote (__FILE__++":"++show __LINE__)
> 
> Thanks
> 
> Neil
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe


---

This e-mail may contain confidential and/or privileged information. If you 
are not the intended recipient (or have received this e-mail in error) 
please notify the sender immediately and destroy this e-mail. Any 
unauthorized copying, disclosure or distribution of the material in this 
e-mail is strictly forbidden.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20071219/47937723/attachment-0001.htm


More information about the Haskell-Cafe mailing list