unisonweb/unison

`view` and `names` of a hash could distinguish between definitions that are unknown vs unnamed

Open

#1,384 opened on Mar 28, 2020

View on GitHub
 (4 comments) (0 reactions) (0 assignees)Haskell (304 forks)batch import
codebase-manager / ucmdxgood first issuehelp wanted

Repository metrics

Stars
 (6,624 stars)
PR merge metrics
 (Avg merge 12d 19h) (6 merged PRs in 30d)

Description

Current behavior:

scratch/main> view ##Nat

  ⚠️
  
  The following names were not found in the codebase. Check your spelling.
    ##Nat

scratch/main> names ##Nat

  😶
  
  I couldn't find anything by that name.

scratch/main> alias.type ##Nat Nat

  Done.

scratch/main> names ##Nat

  Type
  Hash:  ##Nat
  Names: Nat

scratch/main> view ##Nat

  -- Nat is built-in.

Desired behavior would be something like:

scratch/main> view ##Nat

  -- ##Nat is built-in.

scratch/main> names ##Nat

  There are no names for ##Nat in this branch.

scratch/main> view ##Cat

  This version of UCM doesn't provide a built-in called ##Cat.

scratch/main> names ##Cat

  There are no names for ##Cat in this branch.
  (And this version of UCM doesn't provide a built-in called ##Cat.)

scratch/main> names ##Rat

  Type
  Hash:  ##Rat
  Names: Rat
  (Although this branch has a name for it, this version of UCM doesn't provide a built-in called ##Rat.)
  
scratch/main> names #00nv2kob8f

  There are no names for ##00nv2kob8f in this branch, but it is named in the following branches:

  Branch						Name
  @unison/base/main  Unit

or

scratch/main> names #00nv2kob8f

  There are no names for ##00nv2kob8f in this branch, but here's the definition:

  structural type #00nv2kob8f = #00nv2kob8f#0

nice-walrus/main> view #00nv2kob8f Cat #00nv2kob8e

  structural type #00nv2kob8f = #00nv2kob8f#0


  ⚠️
  
  The following names don't exist in this branch:
    Cat

  The following hashes don't exist in this codebase:
    #00nv2kob8e

Contributor guide