Re: [Haskell-cafe] Lazy read

2006-02-20 Thread John Meacham
On Thu, Feb 16, 2006 at 11:28:08PM +, Malcolm Wallace wrote: Essentially, rather than having an indication of success/failure in the type system, using the Maybe or Either types, you are asking to return the typed value itself, with no wrapper, but perhaps some hidden bottoms buried

[Haskell-cafe] Lazy read

2006-02-16 Thread Neil Mitchell
Hi, I have a nice big data structure that I serialise to a file using show, and read back in using read. This data structure has deriving (Read, Show), which makes it all nice and easy to save and load this data structure, without worrying about parsing code etc. The problem is that this data

Re: [Haskell-cafe] Lazy read

2006-02-16 Thread Taral
On 2/16/06, Neil Mitchell [EMAIL PROTECTED] wrote: What is the best way to modify the code to have read operate lazily? Is there any method that doesn't require writing a custom parser? Is there any standard way for solving a problem like this? Honestly, don't use read. It's icky. Check out

Re: [Haskell-cafe] Lazy read

2006-02-16 Thread Neil Mitchell
Honestly, don't use read. It's icky. Check out ReadP or parsec, they are far superior in general. I think there was a suggestion of replacing Read with ReadP? The whole point is not about writing a parser, its about having a parser written for me with deriving Read - unfortunately their is no

Re: [Haskell-cafe] Lazy read

2006-02-16 Thread Malcolm Wallace
Neil Mitchell [EMAIL PROTECTED] writes: Check out ReadP or parsec, they are far superior in general. I think there was a suggestion of replacing Read with ReadP? The whole point is not about writing a parser, its about having a parser written for me with deriving Read - unfortunately