Skip to content

Instantly share code, notes, and snippets.

@droyo
Created March 1, 2021 23:37
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 droyo/57e0ae276018b4470b4b0d49d80f4f33 to your computer and use it in GitHub Desktop.
Save droyo/57e0ae276018b4470b4b0d49d80f4f33 to your computer and use it in GitHub Desktop.
Fmt.(pf ppf "type %s = {@[<v>@,%a@;<1 -2>@]}" name (list ~sep:(any ";@ ") gen_record_field))
result:
type t = {
bar : BarEnum;
baz : BazMsg;
bum : BazMsg.Data;
foomap : (BarEnum * BazMsg)
}
Fmt.(pf ppf "type %s = {@;<1 2>@[<v>%a@;<1 -2>@]}" name (list ~sep:(any ";@ ") gen_record_field))
result:
type t = {
bar : BarEnum;
baz : BazMsg;
bum : BazMsg.Data;
foomap : (BarEnum * BazMsg)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment