Changes between Version 9 and Version 10 of StandardClasses


Ignore:
Timestamp:
Sep 29, 2006 1:51:32 PM (8 years ago)
Author:
ross@…
Comment:

notes on Enum, Bits and Storable

Legend:

Unmodified
Added
Removed
Modified
  • StandardClasses

    v9 v10  
    7979 * `succ` and `pred` are unused. 
    8080 * The default definitions of `enum`* would make more sense if `toEnum` and `fromEnum` used `Integer` instead of `Int`. 
     81 * Some doubt that it makes sense to have `Float` and `Double` instances. 
     82 * It is wierd that `[0,3..20]::[Rational]` includes `21`. 
    8183 
    8284=== The Ix class === 
     
    8688 * Make `Show` a superclass of `Ix`, so that the offending index and range can be shown in exceptions. 
    8789   (All instances of `Ix` in the `base` package are also instances of `Show`.) 
     90 
     91=== The Bits class === 
     92Issues: 
     93 * The `Num` superclass may unduly restrict instances.  The only thing actually needed from `Num` is 0. 
     94 * The `bitSize` method is not defined for all instances, and there is no general way to test whether it can be safely called. 
     95 
     96=== The Storable class === 
     97Issues: 
     98 * Some interfaces require clients to manage the memory for objects, but to treat them abstractly.  In such cases one wants to define `sizeOf` and `alignment` (to use `malloc` or `alloca`), but not `peek` or `poke`.