Ticket #83 (new enhancement)
Look in data definition when checking dangerous vars
|Reported by:||benl||Owned by:|
|Component:||Source Type Inferencer||Version:|
data TwoThings r1 r2 r3 a = ThingOne (Int r2) | ThingTwo (Maybe r3 b)
wrt the mutability / backtracking problem.
The rule should be at generalisation time, If a region var makes other variables dangerous, then hold it constant unless it already has a mutability constraint. If the user wants it to be mutable, then require them to supply a type signature. Otherwise leave it constant.
For example, if we are to generalise:
foo :: TwoThings r1 r2 r3
then make r1 and r3 constant, but leave r2 unconstrained.