Re: [Haskell-cafe] Using _ on the RHS of an equation?

Hi Jason, I like the idea. I've seen some code from Oleg Kiselyov which uses __ (two underscores) in this way. The thing that stops me though, is when I get it wrong, and undefined fires somewhere, but I don't know where. Something like you propose, but with a line number, would be sweet. Paul The University of Glasgow, charity number SC004401

It's quite hacky, but this can be done with CPP and quasiquoting (incidentally, it would be _REALLY_ nice if 'undefined' and 'error' had similar source-location-dependent error messages by default): https://github.com/mokus0/junkbox/commit/bad59f486c3457f1d880a1cfa5b1baa33af... -- James

On 5 April 2011 18:00, James Cook
It's quite hacky, but this can be done with CPP and quasiquoting (incidentally, it would be _REALLY_ nice if 'undefined' and 'error' had similar source-location-dependent error messages by default):
https://github.com/mokus0/junkbox/commit/bad59f486c3457f1d880a1cfa5b1baa33af...
#define undefined [underscore|"undefined" at line __LINE__ in __FILE__|] That's nice, I like it. Wanted something like this for a while. I rarely get exceptions in Haskell so that it's not even a bother when I don't know what line number an exception came from, even undefined, but it's nice to have it.
participants (3)
-
Christopher Done
-
James Cook
-
Paul Keir