[Haskell-cafe] Haskell compilation errors break the complexity encapsulation on DSLs
Alberto G. Corona
agocorona at gmail.com
Tue Apr 23 12:49:59 CEST 2013
I ever was worried about the barrier that the complexity of the Haskell
errors impose to users of DSLs. Many DSLs look so simple that even someone
without knowledge of Haskell can make use of them for some domains.
However when the program is compiled then al the monsters of the
deep appear in the surface: polymorphisms, undefined instances, type errors
reported in a line produced by a type assumption in another, etc. This is
a problem for an industrial use of Haskell in the large scale. For obvious
I would like to know
1) which techniques are used to minimize the problem
2) To suggest some kind of extension that would allow for example to add
extra information to the error messages by the library developer.. For
There is a nice documentation about two kind of errors that are frequent
when using that library:
*A type error of the form: *
* No instance for (UncaughtException MyException)
arising from a use of `g' at examples/docatch.hs:21:32-35
add an instance declaration for (UncaughtException MyException)
In the expression: g ()*
*is the type checker saying: *
*"hey, you are trying to run a computation which throws a
MyExceptionwithout handling it, and I won't let you"
*Either handle it or declare MyException as an
The question: Is it possible to develop a GHC extension that attach (or
prepend) such an explanation to the ghc error?
Or any other alternative that carry out the same functionality.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe