Changes between Version 6 and Version 7 of RelaxedDependencyAnalysis


Ignore:
Timestamp:
Jul 8, 2009 12:20:45 PM (5 years ago)
Author:
ross@…
Comment:

reformat as a proposal

Legend:

Unmodified
Added
Removed
Modified
  • RelaxedDependencyAnalysis

    v6 v7  
    11[[PageOutline]] 
    2 = Relaxed Dependency Analysis = 
     2= Proposal: Relaxed Dependency Analysis = 
    33 
    4 == Brief Explanation == 
     4|| Ticket       || #65  || 
     5|| Dependencies || none || 
     6|| Related      || none || 
     7 
     8== Compiler support == 
     9 
     10|| GHC   || full || 
     11|| nhc98 || full || 
     12|| Hugs  || full || 
     13|| UHC   || ?    || 
     14|| JHC   || full || 
     15|| LHC   || full || 
     16 
     17== Summary == 
    518 
    619In Haskell 98, a group of bindings is sorted into strongly-connected components, and then type-checked in dependency order ([http://haskell.org/onlinereport/decls.html#sect4.5.1 H98 s4.5.1]). As each dependency group is type-checked, any binders of the group that have an explicit type signature are put in the type environment with the specified polymorphic type, and all others are monomorphic until the group is generalized ([http://haskell.org/onlinereport/decls.html#sect4.5.2 H98 s4.5.2]). 
     
    1932As 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`. 
    2033 
    21 However 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 
     34Mark Jones suggested that the dependency analysis should ignore references to variables that have an explicit type signature, and most compilers already implement this. Hence `zag` does not depend on `zig`, and we can infer the type 
    2235{{{ 
    2336zag :: BalancedTree a -> a 
     
    2740Dependency groups are smaller, and more programs type-check. 
    2841 
    29 == References == 
    30  
    31  * [http://haskell.org/onlinereport/decls.html#sect4.5.1 Dependency Analysis] in the Haskell 98 Report 
    32  * [http://www.cse.ogi.edu/~mpj/thih/ Typing Haskell in Haskell], Mark Jones, Haskell Workshop 1999. 
    33  
    34 == Tickets == 
    35 [[TicketQuery(description~=RelaxedDependencyAnalysis)]] 
    36  
    37 == Proposal == 
     42== Description == 
    3843 
    3944Modify the definition of dependency group in the above section to 
     
    4752The 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. 
    4853 
     54== References == 
     55 
     56 * [http://haskell.org/onlinereport/decls.html#sect4.5.1 Dependency Analysis] in the Haskell 98 Report 
     57 * [http://www.cse.ogi.edu/~mpj/thih/ Typing Haskell in Haskell], Mark Jones, Haskell Workshop 1999. 
     58 
     59== Report Delta ==