Changes between Version 60 and Version 61 of Records
- Timestamp:
- 02/26/12 11:52:36 (15 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Records
v60 v61 67 67 === Comparisons === 68 68 69 The benefit of abstracting over field names in Overloading is being able to write code that works against any Record with a given field. So I can have a function: 69 70 The DORF proposal is a variant of SORF with similar goals. However, it only solves the narrow name-spacing issue within a module. If a record is imported into another module, it will still clash. 71 72 DORF and SORF abstract over fields. The benefit of abstracting over field names is being able to write code that works against any Record with a given field. So I can have a function: 70 73 71 74 {{{ … … 82 85 * the extra constraints complicated the type checker and did not play well with higher kinded type variables (at least in the code I had then, I do not claim that this is nessecarily so). 83 86 84 Overloading without abstraction over fields may be able to avoid some of these potential downsides, and a judicious (no virtual fields, etc) implementation of either could look very similar to the programmer. 87 SORF without abstraction over fields may be able to avoid some of these potential downsides, and a judicious (no virtual fields, etc) implementation of either could look very similar to the programmer. 88 89 SORF has also been recognized as an approach to internal type resolution, whereas namespacing would require an internal SORF-like step or some other approach to avoid the need for lots of annotations. 90 85 91 86 92 === Type directed name resolution === … … 112 118 Other FP languages where I looked for a record implementation but it appeared they have no solution for records with the same fields (my information could be wrong/out-dated) ocaml, oz. However, the O in OCaml is for objects, and objects have structural typing that supports abstraction over fields. 113 119 114 I couldn't find great specific information on record implementation ML variants . Best I can tell, SML does not allow records in the same module with the same field. Records from other modules require name-spacing or must be opened up similar to Agda.120 I couldn't find great specific information on record implementation ML variants other than SML#. Best I can tell, SML does not allow records in the same module with the same field. Records from other modules require name-spacing or must be opened up similar to Agda. 115 121 116 122
