Skip to content
  • Sylvain Henry's avatar
    ba089952
    Bignum: add Natural constant folding rules (#15821) · ba089952
    Sylvain Henry authored
    * Implement constant folding rules for Natural (similar to Integer ones)
    
    * Add mkCoreUbxSum helper in GHC.Core.Make
    
    * Remove naturalTo/FromInt
    
      We now only provide `naturalTo/FromWord` as
      the semantics is clear (truncate/zero-extend). For Int we have to deal
      with negative numbers (throw an exception? convert to Word
      beforehand?) so we leave the decision about what to do to the caller.
    
      Moreover, now that we have sized types (Int8#, Int16#, ..., Word8#,
      etc.) there is no reason to bless `Int#` more than `Int8#` or `Word8#`
      (for example).
    
    * Replaced a few `()` with `void#`
    ba089952
    Bignum: add Natural constant folding rules (#15821)
    Sylvain Henry authored
    * Implement constant folding rules for Natural (similar to Integer ones)
    
    * Add mkCoreUbxSum helper in GHC.Core.Make
    
    * Remove naturalTo/FromInt
    
      We now only provide `naturalTo/FromWord` as
      the semantics is clear (truncate/zero-extend). For Int we have to deal
      with negative numbers (throw an exception? convert to Word
      beforehand?) so we leave the decision about what to do to the caller.
    
      Moreover, now that we have sized types (Int8#, Int16#, ..., Word8#,
      etc.) there is no reason to bless `Int#` more than `Int8#` or `Word8#`
      (for example).
    
    * Replaced a few `()` with `void#`
Loading