[Haskell-cafe] Track Exceptions

Carter Schonwald carter.schonwald at gmail.com
Thu Mar 13 19:34:51 UTC 2014


Well, Ghc 7.10 is planned to have Stack Traces, which should be exposed as
part of the Exceptions data model once that gets added,

I believe that will help quite a bit!

-Carter


On Thu, Mar 13, 2014 at 1:09 PM, Ruud Koot <r.koot at uu.nl> wrote:

> On Thu, Mar 13, 2014 at 5:54 PM, Roman Cheplyaka <roma at ro-che.info> wrote:
> > Simply instantiating b with b `Throws` e gives
> >
> >   map :: (a -> b `Throws` e) -> [a] -> [b `Throws` e]
> >
> > Which is actually a more useful type than the one you proposed, because
> it shows
> > that map itself doesn't throw exceptions (so that e.g. computing length
> is
> > safe).
> >
> > Assuming "Throws e" is a monad, you could use mapM instead of map to get
> the
> > behavior you want.
> >
> > In fact, Throws will probably need to be an indexed monad.
> >
> > Roman
>
> Yes, lazyness complicates things even further. You can pass a function
> to map that produces an "exception value" of type b. These exceptions
> would be attached to the elements inside the list [b] as you suggest.
> But there might also be exceptional values hidden inside the spine of
> the second argument of type [a]. These would need to end up in the
> spine of the resulting list of type [b].
>
> Ruud
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140313/a1caf54e/attachment.html>


More information about the Haskell-Cafe mailing list