unison/unison-src/transcripts/fix4172.output.md
2023-07-10 23:29:00 -04:00

1.5 KiB

debug a = match Debug.toText a with
  None -> ""
  Some (Left a) -> a
  Some (Right a) -> a

test> t1 = if bool then [Ok "Yay"] 
           else [Fail (debug [1,2,3])]
bool = true

allowDebug = debug [1,2,3]

  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`:
    
      allowDebug : Text
      bool       : Boolean
      debug      : a -> Text
      t1         : [Result]
  
  Now evaluating any watch expressions (lines starting with
  `>`)... Ctrl+C cancels.

    6 | test> t1 = if bool then [Ok "Yay"] 
    
    ✅ Passed Yay

.> add

  ⍟ I've added these definitions:
  
    allowDebug : Text
    bool       : Boolean
    debug      : a -> Text
    t1         : [Result]

.> test

  Cached test results (`help testcache` to learn more)
  
  ◉ t1   Yay
  
  ✅ 1 test(s) passing
  
  Tip: Use view t1 to view the source of a test.

bool = false

  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:
    
      bool : Boolean

.> update

  ⍟ I've updated these names to your new definition:
  
    bool : Boolean

.> test

  ✅  

  

  

    New test results:
  
  ✗ t1   [1, 2, 3]
  
  🚫 1 test(s) failing
  
  Tip: Use view t1 to view the source of a test.