Changes between Version 6 and Version 7 of Commentary/Compiler/Coercions


Ignore:
Timestamp:
May 11, 2017 4:14:57 PM (3 years ago)
Author:
sgraf
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Compiler/Coercions

    v6 v7  
    2020The last problem is the one that triggered this note, and needs a bit more explanation.  Consider
    2121{{{
    22 class (F a ~ b, Eq a) => C a b where
     22class (F a ~ b, Num a) => C a b where
    2323  op :: a -> b
    2424}}}
     
    3535The Core program we generate looks something like this:
    3636{{{
    37 f = /\a b. \(d:C a b).
     37f = /\a b. \(d:C a b) (x:a).
    3838    let (nd : Num a) = case d of { MkC _ d _ -> d }
    3939    in (+) nd x (fromInteger nd 1)