Proposal: add HasCallStack for all partial functions in base
Oliver Charles
ollie at ocharles.org.uk
Sun Jun 16 19:03:11 UTC 2019
Surely then the call stack is only foldr1, and not foldr1's callsite?
On Sun, 16 Jun 2019, 8:27 pm Henning Thielemann, <
lemming at henning-thielemann.de> wrote:
>
> On Sun, 16 Jun 2019, Simon Jakobi wrote:
>
> > > I think only the partial implementations should get that constraint.
>
> > Oops, I had the misconception that one couldn't add a HasCallStack
> > constraint to method implementations.
>
> I think you have to declare:
>
> instance Foldable [] where
> foldl1 = foldl1List
>
> foldl1List :: HasCallStack => (a->a->a) -> [a] -> a
> foldl1List = ...
>
> Would this work?_______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20190616/dee75304/attachment.html>
More information about the Libraries
mailing list