... | ... | @@ -35,7 +35,7 @@ As with many operations on non-regular (or nested) types, `zig` and `zag` need t |
|
|
|
|
|
|
|
|
|
|
|
However GHC, Hugs, Nhc98, and jhc follow the suggestion of Mark Jones in [ Typing Haskell in Haskell](http://www.cse.ogi.edu/~mpj/thih/), 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
|
|
|
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
|
|
|
|
|
|
|
|
|
```wiki
|
... | ... | @@ -50,3 +50,38 @@ and then go on to successfully check the type signature of `zig`. |
|
|
Dependency groups are smaller, and more programs type-check.
|
|
|
|
|
|
|
|
|
## References
|
|
|
|
|
|
|
|
|
- [ Dependency Analysis](http://haskell.org/onlinereport/decls.html#sect4.5.1) in the Haskell 98 Report
|
|
|
- [ Typing Haskell in Haskell](http://www.cse.ogi.edu/~mpj/thih/), Mark Jones, Haskell Workshop 1999.
|
|
|
|
|
|
## Proposal
|
|
|
|
|
|
|
|
|
|
|
|
Modify the definition of dependency group in the above section to
|
|
|
|
|
|
|
|
|
>
|
|
|
>
|
|
|
> Two variables bound by value declarations are in the same declaration group if either
|
|
|
>
|
|
|
>
|
|
|
|
|
|
>
|
|
|
>
|
|
|
> 1) they are bound by the same pattern binding, or
|
|
|
>
|
|
|
>
|
|
|
|
|
|
>
|
|
|
>
|
|
|
> 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*
|
|
|
>
|
|
|
>
|
|
|
|
|
|
|
|
|
The 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.
|
|
|
|
|
|
|