On Wed, Jul 9, 2014 at 10:12 PM, Raoul Duke <[email protected]> wrote:

> this might be getting ot and silly but i seem to be under the
> impression that the rule of thumb with haskell and ocaml and such is:
>
> * at first you don't manually annotate and things are ok because the
> type inference does it for you.
> * then after 500 lines of code something fails to type check. the
> error is weird and pretty much utterly inscrutable, doesn't really
> match the location it is complaining about.
> * then you either figure out somehow what happened, or you start to
> annotate with what *you* think things should be, and eventually you go
> back far enough to find where the inference went off into la la land,
> but silently succeeded, until later when it hit some la la
> contradiction.
>
> * so from then on you know you should just annotate manually as you go
> along.


That's a pretty good explanation of how type inference works in Haskell.
Less so in ML, incidentally.

The key to the problem was that error diagnostic. The problem is that the
front end is throwing away two much information during unification to tell
you what inference steps derived the bad result. We worked really hard on
doing better diagnostics in BitC. It makes a difference.
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to