unison/unison-src/transcripts/records.output.md
Simon Højberg 16201809f5 Fix records to print with fieldnames
We were attempting to determine a type being a records, by looking
number of accessors and seeing if they matched a freshly generated
number of them. This was not working as we too eagerly removed type
prefixed names thus causing a mismatch.
2021-09-17 14:39:23 -04:00

887 B

Ensure that Records keep their syntax after being added to the codebase

Record with 1 field

unique type Record1 = { a : Text }
.> view Record1

  unique type Record1 = { a : Text }

Record with 2 fields

unique type Record2 = { a : Text, b : Int }
.> view Record2

  unique type Record2 = { a : Text, b : Int }

Record with 3 fields

unique type Record3 = { a : Text, b : Int, c : Nat }
.> view Record3

  unique type Record3 = { a : Text, b : Int, c : Nat }

Record with many fields

unique type Record4 = 
  { a : Text
  , b : Int
  , c : Nat
  , d : Bytes
  , e : Text
  , f : Nat
  , g : [Nat]
  }
.> view Record4

  unique type Record4
    = { a : Text,
        b : Int,
        c : Nat,
        d : Bytes,
        e : Text,
        f : Nat,
        g : [Nat] }