<div dir="ltr">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, <div><br></div><div>I believe that will help quite a bit! </div><div><br></div>

<div>-Carter</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Mar 13, 2014 at 1:09 PM, Ruud Koot <span dir="ltr"><<a href="mailto:r.koot@uu.nl" target="_blank">r.koot@uu.nl</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Thu, Mar 13, 2014 at 5:54 PM, Roman Cheplyaka <<a href="mailto:roma@ro-che.info">roma@ro-che.info</a>> wrote:<br>


> Simply instantiating b with b `Throws` e gives<br>
><br>
>   map :: (a -> b `Throws` e) -> [a] -> [b `Throws` e]<br>
><br>
> Which is actually a more useful type than the one you proposed, because it shows<br>
> that map itself doesn't throw exceptions (so that e.g. computing length is<br>
> safe).<br>
><br>
> Assuming "Throws e" is a monad, you could use mapM instead of map to get the<br>
> behavior you want.<br>
><br>
> In fact, Throws will probably need to be an indexed monad.<br>
><br>
> Roman<br>
<br>
</div>Yes, lazyness complicates things even further. You can pass a function<br>
to map that produces an "exception value" of type b. These exceptions<br>
would be attached to the elements inside the list [b] as you suggest.<br>
But there might also be exceptional values hidden inside the spine of<br>
the second argument of type [a]. These would need to end up in the<br>
spine of the resulting list of type [b].<br>
<span class="HOEnZb"><font color="#888888"><br>
Ruud<br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br></div>