unison/unison-src/transcripts/update-type-missing-constructor.output.md
2024-06-25 11:11:07 -07:00

1.3 KiB

unique type Foo = Bar Nat

  Loading changes detected in scratch.u.

  I found and typechecked these definitions in scratch.u. If you
  do an `add` or `update`, here's how your codebase would
  change:
  
    ⍟ These new definitions are ok to `add`:
    
      type Foo

scratch/main> add

  ⍟ I've added these definitions:
  
    type Foo

scratch/main> delete.term Foo.Bar

  Done.

Now we've set up a situation where the original constructor missing.

unique type Foo = Bar Nat Nat

  Loading changes detected in scratch.u.

  I found and typechecked these definitions in scratch.u. If you
  do an `add` or `update`, here's how your codebase would
  change:
  
    ⍟ These names already exist. You can `update` them to your
      new definition:
    
      type Foo

scratch/main> view Foo

  type Foo = #b509v3eg4k#0 Nat

scratch/main> update

  Okay, I'm searching the branch for code that needs to be
  updated...

  I couldn't complete the update because the type Foo has
  unnamed constructors. (I currently need each constructor to
  have a name somewhere under the type name.)
  
  You can use `view Foo` and
  `alias.term <hash> Foo.<ConstructorName>` to give names to
  each constructor, and then try the update again.