[Haskell-cafe] Lazy read

John Meacham john at repetae.net
Mon Feb 20 22:48:59 EST 2006


On Thu, Feb 16, 2006 at 11:28:08PM +0000, 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 inside.  One could certainly define such a parsing set-up, but
> there are no standard ones I know of.  The attraction of lazy parsing
> is obvious, but there is a cost in terms of safety.

Yeah, I have thought about the best way to do this before, something
like all combinators by default being irrefutable meaning they always
succeed perhaps placing bottoms in the structure, with a specific 'try'
like in parsec that will let you try a path and backtrack locally. I was
thinking something like a continuation based error monad where the
error continuation was 'bottom' unless overridden locally, but I never
could get the types to work out quite right. perhaps rank-n types or
following the process outlined in the parallel parsing combinators paper
will afford a better result.

        John

-- 
John Meacham - ⑆repetae.net⑆john⑈


More information about the Haskell-Cafe mailing list