Skip to content

Instantly share code, notes, and snippets.

@hojberg
Created September 14, 2021 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hojberg/3d55566ac55cc76314dc73119bd63a07 to your computer and use it in GitHub Desktop.
Save hojberg/3d55566ac55cc76314dc73119bd63a07 to your computer and use it in GitHub Desktop.
Unison Records pretty printing transcript

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

.> builtins.mergeio
.> load unison-src/transcripts-using-base/base.u

Record with 1 field

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

Record with 2 fields

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

Record with 3 fields

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

Record with many fields

unique type Record4 = 
  { a : Text
  , b : Int
  , c : Nat
  , d : Bytes
  , e : Text
  , f : Nat
  , g : [Nat]
  }
.> add
.> view Record4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment