<div dir="ltr"><div>Hi</div><div> </div><div>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.</div>

<div> </div><div>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.</div>

<div> </div><div>I would like to know </div><div> </div><div>1) which techniques are used to minimize the problem<br clear="all"></div><div>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 </div>

<div> </div><div><a href="http://hackage.haskell.org/packages/archive/control-monad-exception/0.10.3.1/doc/html/Control-Monad-Exception.html">http://hackage.haskell.org/packages/archive/control-monad-exception/0.10.3.1/doc/html/Control-Monad-Exception.html</a></div>

<div> </div><div>There is a nice documentation about two kind of errors that are frequent when using that library:</div><div> </div><div><p><em>A type error of the form: </em></p><pre><em>    No instance for (UncaughtException MyException)
      arising from a use of `g&#39; at examples/docatch.hs:21:32-35
    Possible fix:
      add an instance declaration for (UncaughtException MyException)
    In the expression: g ()
</em></pre><p><em>is the type checker saying: </em></p><p><em>&quot;hey, you are trying to run a computation which throws a <code>MyException</code> without handling it, and I won&#39;t let you&quot; </em></p><p><em>Either handle it or declare <code>MyException</code> as an <code><a href="http://hackage.haskell.org/packages/archive/control-monad-exception/0.10.3.1/doc/html/Control-Monad-Exception.html#t:UncaughtException"><font color="#0066cc">UncaughtException</font></a></code>. </em></p>

<p> </p><p>The question: Is it possible to develop a GHC extension that attach (or prepend) such an explanation to the ghc error?</p><p> </p><p>Or any other alternative that carry out the same functionality.</p><p><br>-- <br>

Alberto.
</p></div></div>