diff --git a/unison-src/transcripts-round-trip/main.md b/unison-src/transcripts-round-trip/main.md index 20cad5558..9c5a3a4cd 100644 --- a/unison-src/transcripts-round-trip/main.md +++ b/unison-src/transcripts-round-trip/main.md @@ -701,6 +701,41 @@ ex3a = .> load roundtrip.u ``` +```ucm:hide +.> undo +``` + +# Use soft hangs after `with` and in last argument of function application + +```unison:hide roundtrip.u +structural ability Abort where + abort : x + +ex1 = handle + x = 1 + y = abort + x + y + with cases + { a } -> a + { Abort.abort -> _ } -> 0 + +List.foreach x f = 0 + +ex2 = List.foreach [0,1,2,3,4,5] cases + 0 -> 0 + 1 -> 1 + n -> n + 100 +``` + +```ucm:hide +.> add +``` + +```ucm +.> edit ex1 ex2 +.> load roundtrip.u +``` + ```ucm:hide .> undo ``` \ No newline at end of file diff --git a/unison-src/transcripts-round-trip/main.output.md b/unison-src/transcripts-round-trip/main.output.md index 3732a9916..a824c98f8 100644 --- a/unison-src/transcripts-round-trip/main.output.md +++ b/unison-src/transcripts-round-trip/main.output.md @@ -536,8 +536,8 @@ x = '(let handler : a -> Request {Abort} a -> a handler default = cases - { a } -> a - {abort -> _} -> default + { a } -> a + { abort -> _ } -> default x : 'Optional Nat x = @@ -1277,9 +1277,9 @@ bar3 x = do bar2 x = do a = 1 b = 2 - 1 + (foo a do + 1 + (foo a (do c = 3 - a + b) + a + b)) bar3 : x -> () -> b -> Nat bar3 x = do @@ -1949,3 +1949,65 @@ ex3a = file has been previously added to the codebase. ``` +# Use soft hangs after `with` and in last argument of function application + +```unison +--- +title: roundtrip.u +--- +structural ability Abort where + abort : x + +ex1 = handle + x = 1 + y = abort + x + y + with cases + { a } -> a + { Abort.abort -> _ } -> 0 + +List.foreach x f = 0 + +ex2 = List.foreach [0,1,2,3,4,5] cases + 0 -> 0 + 1 -> 1 + n -> n + 100 + +``` + + +```ucm +.> edit ex1 ex2 + + ☝️ + + I added these definitions to the top of + /Users/pchiusano/unison/roundtrip.u + + ex1 : Nat + ex1 = + handle + use Nat + + x = 1 + y = abort + x + y + with cases + { a } -> a + { abort -> _ } -> 0 + + ex2 : Nat + ex2 = + foreach [0, 1, 2, 3, 4, 5] cases + 0 -> 0 + 1 -> 1 + n -> n Nat.+ 100 + + You can edit them there, then do `update` to replace the + definitions currently in this namespace. + +.> load roundtrip.u + + I found and typechecked the definitions in roundtrip.u. This + file has been previously added to the codebase. + +```