Simon encouraged me to bellyache with this reply in public, so here it
is...
> > Having just wasted an hour or so chasing MR-induced errors through
> > a moderate-sized module after introducing a relatively minor change,
> > I feel the need to vent on this topic, yet again.
> Alex, it's fine to do so, but it would be even more valuable
> if you enclosed details fo the bugs you chased. The MR debate
> is disfigured by many words but few concrete examples. Were your errors
> type errors or runtime errors?
Type errors, and ones which would disappear sans the MR.
> Were they hard to find? Give
> snippets of code, and (if relevant) typical error messages. Help us
> to understand what was awkward.
They weren't that hard to find once I realised it was a MR problem,
though annoyingly tedious. One problem is that the error messages
_don't refer to the function on which the MR was applied_, so instead
it just pops up elsewhere. What's annoying is that I don't really
feel they're "errors" at all; I feel they _should_ be well typed,
and I begrudge the effort of having to add type sigs (particularly
on rapidly mutating code), and 'eta-expansion' is really ugly.
I haven't meticulously preserved the changes I had to make, as my main
thought was "get rid of the little beggers". Basically we're
talking the bog-standard MR situation where the 'defaulted' monotype
either disappears, or turns into two different monotypes, so an
overloaded definition like:
acc_hm = acc_m <|. holAccommodation
now needs a type sig (or to be 'eta-expanded'), otherwise I get errors
like:
Metric.hs:382:
A type signature is more polymorphic than the inferred type
Can't for-all the type variable(s) `h'
in the type `Metric h Bool'
When checking the type signature for `acc_price_hm'
Metric.hs:406:
A type signature is more polymorphic than the inferred type
Can't for-all the type variable(s) `h'
in the type `Metric h (Priority Bool Price)'
When checking the type signature for `acc_prio_price_hm2'
Metric.hs:290:
Ambiguous type variable(s)
`h' in the constraint `Holidays h'
arising from use of `holAccommodation' at Metric.hs:290
in the various _usages_ of acc_hm, without ever directly identifying
it as such.
Obviously this goes away when I add:
acc_hm :: Holidays h => Metric h Bool
but repeat this for dozens of function definitions, arising from a
fairly small change elsewhere, and you have one narked-off programmer.
I hope this helps, though I fear I'm pretty much just belabouring
what you already know, amn't I?
Slan leat,
Alex.