[Haskell] Re: [Haskell-cafe] ANNOUNCE: enumerator, an alternative iteratee package

Magnus Therning magnus at therning.org
Tue Aug 24 01:44:08 EDT 2010


On 24/08/10 03:47, John Millikin wrote:
[...]
> I would like to avoid hard-coding the error type to SomeException, because
> it forces libraries to use unsafe/unportable language features (dynamic
> typing and casting). However, given the apparent practical requirement that
> all iteratees have the same error type, it seems like there's no other
> choice.

I haven't worked enough with iteratees to have an informed opinion on this,
but I wonder what the pros and cons are of having an error state in the
iteratees at all.  In other words, why would this

  data Step a m b
      = Continue (Stream a -> Iteratee a m b)
      | Yield b (Stream a)
      | Error E.SomeException

be preferred over this

  data Step a m b
      = Continue (Stream a -> Iteratee a m b)
      | Yield b (Stream a)

(Maybe with the restriction that m is a MonadError.)

/M

-- 
Magnus Therning                        (OpenPGP: 0xAB4DFBA4)
magnus@therning.org           Jabber: magnus@therning.org
http://therning.org/magnus         identi.ca|twitter: magthe

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20100824/5996e5d5/signature.bin


More information about the Haskell-Cafe mailing list