Hi, Am Mittwoch, den 20.01.2016, 09:24 -0800 schrieb Eric Seidel: > The problem is that I don't know how to implement > `withFrozenCallStack` > (included in the wiki) as a Haskell function if CallStacks aren't > implicit parameters under-the-hood.
breaking it further down, the problem is not with `withFrozenCallStack` per se, but rather with any code that wants to set the current callstack, e.g. anything of the current form let ?callStack = ... in .. How would that look with a magic nullary constraint "AppendsCallStack"? It’d probably need a built-in function setCallStack :: CallStack -> (AppendsCallStack => a) -> a with which we can likely implement `withFrozenCallStack` again: withFrozenCallStack :: AppendsCallStack => (AppendsCallStack => a) -> a withFrozenCallStack do_this = -- we pop the stack before freezing it to remove -- withFrozenCallStack's call-site let callStack = freezeCallStack (popCallStack callStack) in setCallStack callStack do_this It might need a second call to popCallStack depending on the precise semantics of `callStack :: AppendsCallStack => CallStack` (i.e. whether that does pop one entry off itself). Greetings, Joachim -- Joachim “nomeata” Breitner [email protected] • http://www.joachim-breitner.de/ Jabber: [email protected] • GPG-Key: 0xF0FBF51F Debian Developer: [email protected]
signature.asc
Description: This is a digitally signed message part
_______________________________________________ ghc-devs mailing list [email protected] http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
