unison icon indicating copy to clipboard operation
unison copied to clipboard

sort out misnamed variables issues revealed in #2138

Open aryairani opened this issue 4 years ago • 1 comments

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.

aryairani avatar Jun 28 '21 17:06 aryairani

@dolio Let me know if the codebase needs to support a more structured Symbol type.

aryairani avatar Jun 28 '21 17:06 aryairani