Changes between Version 6 and Version 7 of NewAxioms/DiscussionPage


Ignore:
Timestamp:
Jun 11, 2012 5:23:36 AM (3 years ago)
Author:
AntC
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • NewAxioms/DiscussionPage

    v6 v7  
    124124}}}
    125125
    126   (For reasons I don't understand) when GHC introduced Associated Types (Families), they seemed particularly concerned about partial overlaps (and confluence thereof). Compare that Hugs handles pertial overlaps badly, so it's usually better to 'factor' into total overlaps. (That is: if you have instances like (2) and (3), add an instance like (1).)
     126  (For reasons I don't understand) when GHC introduced Associated Types (Families), they seemed particularly concerned about partial overlaps (and confluence thereof http://www.haskell.org/haskellwiki/GHC/Indexed_types section 6.2.2 Overlap). Compare that Hugs handles partial overlaps badly, so it's usually better to 'factor' into total overlaps. (That is: if you have instances like (2) and (3), add an instance like (1).)
     127
     128  If you allow only total overlaps, validation of the instances seems more tractable, and the rules for selecting the instance at the use site would be more coherent (perhaps?). Is it the possibility of partial overlap that led to GHC's validation being more 'generous'/less eager?
    127129
    128130 * '''Generalisation and Unification of instance groups''' and disequality guards
     
    139141        G Bool   b   = b                         -- no overlap
    140142
    141     -- take an instance with disequality guards:
     143    -- take an instance with (putative) disequality guards:
    142144    type instance G a b | a /~ (_, _), a /~ Bool = a
    143145    -- generalise: