Changes between Version 4 and Version 5 of RelaxedDependencyAnalysis


Ignore:
Timestamp:
Jan 27, 2006 10:19:26 AM (8 years ago)
Author:
ross@…
Comment:

add proposal

Legend:

Unmodified
Added
Removed
Modified
  • RelaxedDependencyAnalysis

    v4 v5  
    2121As with many operations on non-regular (or nested) types, `zig` and `zag` need to be polymorphic in the element type. In Haskell 98, the bindings of the two functions are interdependent, and thus constitute a single binding group. When type inference is performed on this group, `zig` may be used at different types, because it has a user-supplied polymorphic signature. However, `zag` may not, and the example is rejected, unless we add an explicit type signature for `zag`. 
    2222 
    23 However GHC, Hugs, Nhc98, and jhc follow the suggestion of Mark Jones in [http://www.cse.ogi.edu/~mpj/thih/ Typing Haskell in Haskell], that the dependency analysis should ignore references to variables that have an explicit type signature. Hence `zag` does not depend on `zig`, and we can infer the type 
     23However GHC, Hugs, Nhc98, and jhc follow the suggestion of Mark Jones that the dependency analysis should ignore references to variables that have an explicit type signature. Hence `zag` does not depend on `zig`, and we can infer the type 
    2424{{{ 
    2525zag :: BalancedTree a -> a 
     
    2828 
    2929Dependency groups are smaller, and more programs type-check. 
     30 
     31== References == 
     32 
     33 * [http://haskell.org/onlinereport/decls.html#sect4.5.1 Dependency Analysis] in the Haskell 98 Report 
     34 * [http://www.cse.ogi.edu/~mpj/thih/ Typing Haskell in Haskell], Mark Jones, Haskell Workshop 1999. 
     35 
     36== Proposal == 
     37 
     38Modify the definition of dependency group in the above section to 
     39 
     40  Two variables bound by value declarations are in the same declaration group if either 
     41 
     42  1) they are bound by the same pattern binding, or 
     43 
     44  2) their bindings are mutually recursive (perhaps via some other declarations that are also part of the group), ''ignoring uses of variables that have an explicit type signature''  
     45 
     46The semi-formal rules in the rest of the section would have to go: it would no longer be possible to make binding groups explicit with a source-to-source transformation. 
     47