Changes between Version 29 and Version 30 of ExtensibleRecords


Ignore:
Timestamp:
Nov 26, 2007 1:40:22 AM (6 years ago)
Author:
barney
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ExtensibleRecords

    v29 v30  
    3737 * Repeated Fields:: Is `{X :: Int, X :: Int}` a valid record type? Both '''Poor Man's Records''' and '''Scoped Labels''' allow this type, but other systems consider this an error.  
    3838 
    39  Ok, opinion (since you asked for it!) :: The problem with scoping is that, in most cases, repeated fields are a programmer error, and the point of types is to catch such errors at compile time. At first sight, the ability to scope fields in this way looks like extra power to the programmer, but is this actually useful? I've seen no convincing examples where scoping allows a more clearly structured program, whereas there are plenty of cases where it will mean an error goes uncaught. If you have a good example of scoping, please add it to the examples section on this page.  
    40  
    41  .:: The problem with unpermuted records is illustrated in the example at the bottom of this page: it forces you to make functions polymorphic when they "ought" to be monomorphic. This means that no-one can use records in a straightforward way without understanding the details of all the predicates.  
    42  
    43  .:: In both cases, the usual approach (permutation, no repeats) is what most programmers expect. We have to remember that this proposal is supposed to be ''the'' records system for Haskell. It must be the right system for simple problems as well as complex ones.  
    44  
    45  .:: I totally disagree. More operations aren't always better! What the language needs is a records system which allows and encourages you to structure your code in the clearest possible way. In my opinion, choosing a type system which behaves as expected is an important part of that, but I would quickly be convinced otherwise by some examples which show that these extra features help to write better code. Personal comments, on the other hand, don't help. 
    46  
    47  .:: The way forward (as I see it) is to implement all the various possible designs as libraries (with the necessary compiler support) and then see which library is best in practice. 
    48  
     39  
    4940 
    5041= Label Namespace =