Changes between Version 47 and Version 48 of Records/NameSpacing


Ignore:
Timestamp:
Feb 22, 2012 3:53:06 AM (2 years ago)
Author:
guest
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Records/NameSpacing

    v47 v48  
    169169Note that this means it is possible to improve upon Frege in the number of cases where the type can be inferred - we could look to see if there is only one record namespace containing n, and if that is the case infer the type of x -- Greg Weber 
    170170 
     171Greg, that's dangerous territory: in general Haskell requires evidence for inferrence, rather than defaulting. Suppose we add an import. Then suddenly code that was working fine fails to compile. (Or worse: it compiles but gives different results because it's inferring a different record type.) Compare the experience with overlapping instances. -- AntC 
     172 
    171173For example, lets say we have: 
    172174 
     
    212214I estimate that in 2/3 of all cases one does not need to write `T.e x` in sparsely type annotated code, despite the fact that the frege type checker has a left to right bias and does not yet attempt to find the type of `x` in the code that "follows" the `x.e` construct (after let unrolling etc.) I think one could do better and guarantee that, if the type of `x` is inferrable at all, then so will be `x.e` (Still, it must be more than just a type variable.) 
    213215 
     216Does Frege have record fields with higher-ranked types? (As are needed to simulate object-oriented behaviour using records.) Does it cope with extracting a h-r field and applying it to different argument types? See the discussion under SORF, and SPJ's 'trick' using equality constraints on the `Has` class instance. -- AntC 
     217 
    214218 
    215219== Syntax for updates (in the Frege manual) == 
     
    224228  Does this cope with the tricky cases discussed in the SORF proposal? -- AntC 
    225229    * An update to an existing record that changes the type of a field. 
    226     * An update to an existing record that changes the type of the record[[BR]] (Such as where it's parametric in the type of a field.) 
     230    * An update to an existing record that changes the type of the record.[[BR]] (Such as where it's parametric in the type of a field.) 
    227231    * An update to a higher-ranked field. 
    228232    * An update to a higher-ranked field with constraints.