[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
Hi
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
reasons.
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
example, in
http://hackage.haskell.org/packages/archive/control-monad-exception/0.10.3.1/doc/html/Control-Monad-Exception.html
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
Possible fix:
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
UncaughtException<http://hackage.haskell.org/packages/archive/control-monad-exception/0.10.3.1/doc/html/Control-Monad-Exception.html#t:UncaughtException>.
*
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.
--
Alberto.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130423/66b4f26c/attachment.htm>
More information about the Haskell-Cafe
mailing list