The dreaded M-R

Malcolm Wallace Malcolm.Wallace at
Mon Jan 30 09:56:28 EST 2006

lennart at writes:

> Nhc didn't use to implement the M-R (maybe it does now).  When
> porting code to nhc this caused a few code changes.  Perhaps
> 10 lines out of 10000 when I tried the Bluespec compiler.  So
> my gut feeling is that the M-R is a rare beast in practise.

I can confirm that nhc98 (and hence yhc) still does not implement
the M-R.  I haven't noticed any particular performance problems in
code compiled by nhc98 that were down to a consequent loss of sharing.
(But I can't claim to have explicitly looked.)  But as Lennart says,
you do get occasional type errors which mean you need to restructure
your code.  Almost always, these are local bindings, e.g.:

    Context required in LHS pattern

is an error emitted for code like:

    do (x,y) <- something complicated and numeric

and the fix is

    do xy <- something complicated and numeric
       let x = fst xy
           y = snd xy

As I recall, there were about 4-5 of these I needed to fix in the
entire nofib suite.


More information about the Haskell-prime mailing list