Changes between Version 8 and Version 18 of Ticket #12708


Ignore:
Timestamp:
Nov 20, 2016 8:12:32 PM (3 years ago)
Author:
Iceland_jack
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #12708 – Description

    v8 v18  
    77import GHC.Types
    88
    9 class Num (a :: Type k) where
     9class Num (a :: TYPE k) where
    1010  (+)    :: a -> a -> a
    1111  (-)    :: a -> a -> a
     
    3333
    3434  fromInteger :: Integer -> Int#
    35   fromInteger (fromInteger -> I# int) = int
     35  fromInteger (fromInteger @PtrRepLifted @Int -> I# int) = int
    3636
    3737
     
    5252
    5353  fromInteger :: Integer -> Double#
    54   fromInteger (fromInteger -> D# dbl) = dbl
     54  fromInteger (fromInteger @PtrRepLifted @Double -> D# dbl) = dbl
    5555}}}
    5656
     
    5959{{{#!hs
    6060instance P.Num a => Num (a :: Type) where
    61   (+) = (P.+)
    62   (-) = (P.-)
    63   (*) = (P.*)
    64   negate      = P.negate
    65   abs         = P.abs
    66   signum      = P.signum
    67   fromInteger = P.fromInteger
     61  (+)         = (P.+)         @a
     62  (-)         = (P.-)         @a
     63  (*)         = (P.*)         @a
     64  negate      = P.negate      @a
     65  abs         = P.abs         @a
     66  signum      = P.signum      @a
     67  fromInteger = P.fromInteger @a
    6868}}}
    6969
     
    7878instance P.Show a => Show (a :: Type) where
    7979  show :: (a :: Type) -> String
    80   show = P.show
     80  show = P.show @a
    8181
    82 instance Show Int# where
     82instance Show (Int# :: TYPE IntRep) where
    8383  show :: Int# -> String
    84   show int = show (I# int)
     84  show int = show @PtrRepLifted @Int (I# int)
    8585
    86 instance Show Double# where
     86instance Show (Double# :: TYPE DoubleRep) where
    8787  show :: Double# -> String
    88   show dbl = show (D# dbl)
     88  show dbl = show @PtrRepLifted @Double (D# dbl)
    8989}}}
    9090