On Mon April 21 2008 3:26:04 pm Magnus Therning wrote:
> In order to allow lazy decoding I ended up exporting decode' as well:
>
>   decode' :: String -> [Maybe Word8]

I take it that in a situation like this, you'd have either:

[]   -- success with empty result

a list full of Just x
     -- success with valid results

a list with 0 or more Just x, followed by one Nothing
     -- an error

Makes sense to me.  What impact does this have on performance?

Also, I wonder if there is some call for tools in Data.Either to support this 
type of usage?  For example:

type EitherList a b = [Either a b]

then some functions such as, say, mapEither or foldEither that act like 
try/catch: a special function to use for an exception, and otherwise 
they "unwrap" the Right side passing it along to others.

-- John
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to