unison/unison-src/transcripts/pattern-pretty-print-2345.output.md

205 lines
3.2 KiB
Markdown
Raw Permalink Normal View History

2021-09-02 03:34:19 +03:00
Regression test for https://github.com/unisonweb/unison/pull/2377
``` unison
2021-09-02 03:34:19 +03:00
structural ability Ab where
a: Nat -> ()
dopey = cases
?0 -> ()
_ -> ()
2021-09-02 03:34:19 +03:00
grumpy = cases
d -> ()
happy = cases
true -> ()
false -> ()
2021-09-02 03:34:19 +03:00
sneezy = cases
+1 -> ()
_ -> ()
2021-09-02 03:34:19 +03:00
bashful = cases
Some a -> ()
_ -> ()
2021-09-02 03:34:19 +03:00
mouthy = cases
[] -> ()
_ -> ()
2021-09-02 03:34:19 +03:00
pokey = cases
h +: t -> ()
_ -> ()
2021-09-02 03:34:19 +03:00
sleepy = cases
i :+ l -> ()
_ -> ()
2021-09-02 03:34:19 +03:00
demure = cases
[0] -> ()
_ -> ()
2021-09-02 03:34:19 +03:00
angry = cases
a ++ [] -> ()
tremulous = cases
(0,1) -> ()
_ -> ()
2021-09-02 03:34:19 +03:00
throaty = cases
{ Ab.a a -> k } -> ()
{ _ } -> ()
2021-09-02 03:34:19 +03:00
agitated = cases
a | a == 2 -> ()
_ -> ()
2021-09-02 03:34:19 +03:00
doc = cases
y@4 -> ()
_ -> ()
2021-09-02 03:34:19 +03:00
```
``` ucm
2021-09-02 03:34:19 +03:00
Loading changes detected in scratch.u.
2021-09-02 03:34:19 +03:00
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`:
structural ability Ab
agitated : Nat -> ()
angry : [t] -> ()
bashful : Optional a -> ()
demure : [Nat] -> ()
doc : Nat -> ()
dopey : Char -> ()
grumpy : ff284oqf651 -> ()
2021-09-02 03:34:19 +03:00
happy : Boolean -> ()
mouthy : [t] -> ()
pokey : [t] -> ()
sleepy : [t] -> ()
sneezy : Int -> ()
throaty : Request {g, Ab} x -> ()
2021-09-02 03:34:19 +03:00
tremulous : (Nat, Nat) -> ()
```
``` ucm
scratch/main> add
2021-09-02 03:34:19 +03:00
⍟ I've added these definitions:
structural ability Ab
agitated : Nat -> ()
angry : [t] -> ()
bashful : Optional a -> ()
demure : [Nat] -> ()
doc : Nat -> ()
dopey : Char -> ()
grumpy : ff284oqf651 -> ()
2021-09-02 03:34:19 +03:00
happy : Boolean -> ()
mouthy : [t] -> ()
pokey : [t] -> ()
sleepy : [t] -> ()
sneezy : Int -> ()
throaty : Request {g, Ab} x -> ()
2021-09-02 03:34:19 +03:00
tremulous : (Nat, Nat) -> ()
scratch/main> view dopey
2021-09-02 03:34:19 +03:00
dopey : Char -> ()
dopey = cases
?0 -> ()
_ -> ()
2021-09-02 03:34:19 +03:00
scratch/main> view grumpy
2021-09-02 03:34:19 +03:00
grumpy : ff284oqf651 -> ()
2021-09-02 03:34:19 +03:00
grumpy = cases d -> ()
scratch/main> view happy
2021-09-02 03:34:19 +03:00
happy : Boolean -> ()
happy = cases
true -> ()
false -> ()
2021-09-02 03:34:19 +03:00
scratch/main> view sneezy
2021-09-02 03:34:19 +03:00
sneezy : Int -> ()
sneezy = cases
+1 -> ()
_ -> ()
2021-09-02 03:34:19 +03:00
scratch/main> view bashful
2021-09-02 03:34:19 +03:00
bashful : Optional a -> ()
bashful = cases
Some a -> ()
_ -> ()
2021-09-02 03:34:19 +03:00
scratch/main> view mouthy
2021-09-02 03:34:19 +03:00
mouthy : [t] -> ()
mouthy = cases
[] -> ()
_ -> ()
2021-09-02 03:34:19 +03:00
scratch/main> view pokey
2021-09-02 03:34:19 +03:00
pokey : [t] -> ()
pokey = cases
h +: t -> ()
_ -> ()
2021-09-02 03:34:19 +03:00
scratch/main> view sleepy
2021-09-02 03:34:19 +03:00
sleepy : [t] -> ()
sleepy = cases
i :+ l -> ()
_ -> ()
2021-09-02 03:34:19 +03:00
scratch/main> view demure
2021-09-02 03:34:19 +03:00
demure : [Nat] -> ()
demure = cases
[0] -> ()
_ -> ()
2021-09-02 03:34:19 +03:00
scratch/main> view angry
2021-09-02 03:34:19 +03:00
angry : [t] -> ()
angry = cases a ++ [] -> ()
scratch/main> view tremulous
2021-09-02 03:34:19 +03:00
tremulous : (Nat, Nat) -> ()
tremulous = cases
(0, 1) -> ()
_ -> ()
2021-09-02 03:34:19 +03:00
scratch/main> view throaty
2021-09-02 03:34:19 +03:00
throaty : Request {g, Ab} x -> ()
throaty = cases
2023-07-21 09:12:22 +03:00
{ Ab.a a -> k } -> ()
{ _ } -> ()
2021-09-02 03:34:19 +03:00
scratch/main> view agitated
2021-09-02 03:34:19 +03:00
agitated : Nat -> ()
agitated = cases
a | a == 2 -> ()
_ -> ()
2021-09-02 03:34:19 +03:00
scratch/main> view doc
2021-09-02 03:34:19 +03:00
doc : Nat -> ()
doc = cases
y@4 -> ()
_ -> ()
2021-09-02 03:34:19 +03:00
```