[Haskell-cafe] streaming with logs / metadata

Evan Laforge qdunkan at gmail.com
Mon Apr 8 21:38:11 UTC 2019


> Anything beyond the Functor instance for (Either e), though, models exceptions that abort the computation as soon as the first Left arises. You seem to use the type in a different way which may be one reason why you do not find your functions implemented elsewhere. For logging or warnings, most Haskellers use something like a writer monad transformer. The underlying monad,
>
> Writer w a = (w,a)

That's the thing I was saying destroys streaming.  The problem is that
it returns ([log], [a]), instead of [Either log a], so the
interleaving has been lost.


More information about the Haskell-Cafe mailing list