Changes between Version 19 and Version 20 of InjectiveTypeFamilies


Ignore:
Timestamp:
Oct 22, 2014 6:48:25 AM (5 years ago)
Author:
jstolarek
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • InjectiveTypeFamilies

    v19 v20  
    152152type family F a = result | result -> a where
    153153    F Char = Bool
    154     F Bool = Int
    155     F Int  = Char
     154    F Bool = Char
     155    F a    = a
    156156
    157157idChar :: (F a ~ Bool) => a -> Char
    158158idChar a = a
    159 }}}
    160 
    161 GHC should infer that `a` is in fact `Char`. Right now this program is rejected.
     159
     160idDouble :: (F b ~ Double) => b -> Double
     161idDouble a = a
     162}}}
     163
     164GHC should infer that `a` is in fact `Char` and `b` is `Double`. Right now this program is rejected.
    162165
    163166'''Example 2''' (taken from [ticket:6018#comment:5])