Page MenuHomePhabricator

Discuss Further Whether to Persist Expansions to List Type to Aid Canonicalization
Open, MediumPublic

Description

Let's say a type is defined like

Z10009 -> {
  Z1K1: 'Z7',
  Z7K1: 'Z881',
  Z881K1: 'Z6'
}

Because type expansion is no longer persistent, canonicalization can no longer see that Z10009 is a list type, and so an output list returned to the UI looks something like

{
  Z1K1: 'Z10009',
  K1: 'first elem',
  K2: {
    Z1K1: 'Z10009',
    K1: 'second elem',
    K2: {
      Z1K1: 'Z10009'
    }
  }
}

instead of its former representation, which was

['Z6', 'first elem', 'second elem']

One issue here is that the current status supports nominal (as opposed to structural) equivalence, which may be a desirable trait. However, the system does not rigorously insist on nominal equivalence elsewhere, so that may be a separate discussion.

Event Timeline

If this task is taken on, then the file test_data/Z10103-expanded.json in function-orchestrator will change; the test output will look like a Benjamin array instead of a canonical-form version of a normal Typed List.