unison
unison copied to clipboard
sort out misnamed variables issues revealed in #2138
We saw in #2138 that synthetic vars (is the problem limited to synthetic vars?) can render wrong:
.> view List.map
base.List.map : (a ->{𝕖} b) -> [a] ->{𝕖} [b]
base.List.map f a =
go i as acc =
match List.at i as with
None -> acc
Some a ->
use Nat +
go (i + 1) as (acc :+ f a)
go 0 a []
.> display List.map
go f i as acc =
_pattern = List.at i as
match _pattern with
None -> acc
Some _pattern1 ->
use Nat +
go f (i + 1) as (acc :+ f _pattern)
f a -> go f 0 a []
a gets lost and with the new name doesn't reference (_pattern) the right variable (_pattern1).
@pchiusano had said https://github.com/unisonweb/unison/pull/2138#discussion_r659882357.
Feel free to edit this ticket description.
@dolio Let me know if the codebase needs to support a more structured Symbol type.