... | ... | @@ -109,24 +109,22 @@ with: |
|
|
> In general the static semantics are given by the normal Hindley-Milner inference rules. A dependency analysis transformation is first performed to increase polymorphism.
|
|
|
|
|
|
>
|
|
|
> A variable *x**depends* on a variable *y* (bound in the same list of declarations) if
|
|
|
> A binding *b<sub>1</sub>**depends* on a binding *b<sub>2</sub>* if either
|
|
|
|
|
|
> >
|
|
|
> > 1) they are bound by the same pattern binding, or
|
|
|
|
|
|
> >
|
|
|
> > 2) *y* has no type signature and the binding defining *x* contains an occurrence of *y*, or
|
|
|
> > 1) *b<sub>1</sub>* uses a variable *x* that has no type signature and is defined by *b<sub>2</sub>*, or
|
|
|
|
|
|
> >
|
|
|
> > 3) *x* depends on a variable *z* that depends on *y*.
|
|
|
> > 2) *b<sub>1</sub>* depends on a binding that depends on *b<sub>2</sub>*.
|
|
|
|
|
|
>
|
|
|
> A *declaration group* is a minimal set of bindings of mutually dependent variables. Hindley-Milner type inference is applied to each declaration group in dependency order. The order of declarations in `where`/`let` constructs is irrelevant.
|
|
|
> A *declaration group* is a minimal set of mutually dependent bindings. Hindley-Milner type inference is applied to each declaration group in dependency order. The order of declarations in `where`/`let` constructs is irrelevant.
|
|
|
|
|
|
|
|
|
Notes:
|
|
|
|
|
|
- also tightens up the original wording, which didn't mention that the declarations had to be in the same list and also defined *declaration group* but not dependency.
|
|
|
- defining dependencies between bindings is a little simpler than dependencies between variables.
|
|
|
- the dependency analysis transformation formerly listed in this section is no longer always possible.
|
|
|
|
|
|
|
... | ... | |