How do I use CallStack?

Levent Erkok erkokl at
Mon Dec 7 04:48:42 UTC 2015

There's a function for that:

On Sun, Dec 6, 2015 at 8:43 PM, Richard Eisenberg <eir at> wrote:

> Hi devs,
> I wish to use the new CallStack feature to track call sites of a function.
> I want my function to print out where it was called from. I do not want to
> call `error`. How do I do this?
> I looked in the release notes. They describe the CallStack feature at an
> overview, and the docs suggest that it has a Show instance. But the notes
> don't say where to import CallStack from. I found it in GHC.Stack, but I'm
> unsure this is the right place to take it from. The GHC release notes also
> refer me to the ghc-prim release notes. These (which I assume are ghc-prim/
> don't discuss CallStack. In any case, when I try to `show
> ?callstack`, I learn that CallStack is not an instance of Show, or I
> somehow haven't imported the instance.
> Help?
> Thanks!
> Richard
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the ghc-devs mailing list