[Haskell-cafe] code-as-config, run-time checks and error locations

Steffen Schuldenzucker sschuldenzucker at uni-bonn.de
Sat Apr 6 19:23:05 CEST 2013


Dear Café,

I'm working on a EDSL that will include both type checks (at compile
time) and semantic checks (at run time). - Semantic properties are known
at compile time but feel too complex to me to be encoded in the type system.

If one of the runtime checks fails, I'd like to print the location of 
the error, i.e. not
   Error: Unknown field `AMOUNT' in table `ENTRIES'
(where? why?)
but
   Error: Unknown field `AMOUNT' in table `ENTRIES'
   Referenced at analysis1.hs:43:7 by `sumByInvoice'
     which was called at analysis1.hs:66:3 by `main'
   ENTRIES defined at analysis1.hs:13:8

I'm not yet sure which level of granularity I want for error messages
and one can probably get arbitrarily fancy on this.
For the moment I think it would be enough to auto-insert the location of
calls to a certain set of functions.

Any experience on this?

Thanks a lot.
-- Steffen




More information about the Haskell-Cafe mailing list