shen-elisp icon indicating copy to clipboard operation
shen-elisp copied to clipboard

Better error message on wrong types

Open MHOOO opened this issue 9 years ago • 1 comments
trafficstars

When passing a wrong type to a typechecked function, the resulting error simply prints "type error" without any further information, such as the stacktrace, expected type and argument number.

Would it be difficult to add this information?

MHOOO avatar Oct 09 '16 17:10 MHOOO

This is the default behavior of Shen which is unfortunately counterintuitive to anyone coming from ML style type systems.

Whenever you see that, try doing (spy +) at the REPL. This toggles a "type level debugger" that allows you to step through the deductions.

See http://www.youtube.com/watch?v=BUJNyHAeAc8&t=14m7s which addresses this specifically.

deech avatar Oct 09 '16 18:10 deech