Changes between Version 7 and Version 8 of TypeDirectedNameResolution
- Timestamp:
- 11/17/09 10:00:41 (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TypeDirectedNameResolution
v7 v8 7 7 || Related || [wiki:ExistingRecords] || 8 8 9 See email thread at [http://thread.gmane.org/gmane.comp.lang.haskell.cafe/61723]10 11 Right at the end of the page is a straw poll about the proposal. 9 See also 10 * email thread at [http://thread.gmane.org/gmane.comp.lang.haskell.cafe/61723] 11 * The [http://haskell.org/haskellwiki/TypeDirectedNameResolution publicly-editable TDNR discussion page], and straw poll 12 12 13 13 == Exploiting the power of the dot == … … 100 100 For example, `a`, `a.f` and `a.f.g` are atoms. 101 101 102 * The dynamic semant cs of `a.f` is simply reverse application `(f a)`.102 * The dynamic semantics of `a.f` is simply reverse application `(f a)`. 103 103 104 104 * Unlike normal unqualified variable occurrences, it is legal for there to be many `f`'s … … 122 122 and the standard notation for that is "r.f". 123 123 * TDNR is doing the same job as Haskell's existing qualified names, 124 so it makes sense to use the sane notat oin.124 so it makes sense to use the sane notation. 125 125 126 126 Of course, there is a problem: Haskell already uses dot for (a) … … 205 205 can be any old function whose type looks like "''t1 -> t2''". So the 206 206 first argument of a curried function is special. For example, 207 consider a finite map module with signatur s like this:207 consider a finite map module with signatures like this: 208 208 {{{ 209 209 data Map k v … … 253 253 problem is that you could then ''only'' refer to `x` and `y` using 254 254 TDNR, and I rather dislike that; I would prefer TDNR to be a convenient 255 abbrev ation for something one could write more verbosely. If you255 abbreviation for something one could write more verbosely. If you 256 256 like, what is their "original name"? 257 257 … … 276 276 `get`? Arguably yes: if we allow both S and T to be defined in the 277 277 same module, even though they have the same field names, 278 it'd make sen e to allow their accessor functions to278 it'd make sense to allow their accessor functions to 279 279 defined too. 280 280 … … 283 283 TDNR. This latter is different to record fields (whose types are 284 284 inherently suitable). So I propose to allow a module to contain 285 muliple types with the same field; but not mul iple functions with the285 muliple types with the same field; but not multiple functions with the 286 286 same name. 287 287 … … 311 311 What about `(.x.y)`? Does that expand to `(\f -> f.x.y)`? 312 312 313 = Straw poll =314 315 It's hard to gauge how much people like proposals like this, so let's try the experiment of collecting votes here:316 317 Names of people who would positively like to see TDNR happen (say briefly why)318 * Simon PJ (I wrote the proposal)319 320 Names of people who think that on balance it's a bad idea321 * fill in here322 323 == Other comments ==324 325 ''Add your own comments here''
