Skip to content

Minor prettify printing of tuple types and constructor declaration#485

Merged
damiendoligez merged 1 commit intoocaml:trunkfrom
kayceesrk:trunk
Feb 25, 2016
Merged

Minor prettify printing of tuple types and constructor declaration#485
damiendoligez merged 1 commit intoocaml:trunkfrom
kayceesrk:trunk

Conversation

@kayceesrk
Copy link
Copy Markdown
Contributor

Adds an extra whitespace before * while printing tuple types and constructor declarations through dsource. The following file:

$ cat test.ml
type _ t1 = T1 : int t1 * string t1 -> string t1
type t2 = T2 of int * string
type t3 = (int * string)

is printed as:

$ ocamlc -dsource test.ml 
type _ t1 =
  | T1: int t1* string t1 -> string t1 
type t2 =
  | T2 of int* string 
type t3 = (int* string)

and with the fix is printed as:

type _ t1 =
  | T1: int t1 * string t1 -> string t1 
type t2 =
  | T2 of int * string 
type t3 = (int * string)

@damiendoligez
Copy link
Copy Markdown
Member

Thanks for the patch.

damiendoligez added a commit that referenced this pull request Feb 25, 2016
Minor prettify printing of tuple types and constructor declaration
@damiendoligez damiendoligez merged commit 8553eea into ocaml:trunk Feb 25, 2016
mshinwell pushed a commit to mshinwell/ocaml that referenced this pull request Jun 30, 2021
PR ocaml#470 propagates substitutions down into lambdas, which works when the
RHS is a constant or symbol but not if it's a variable, since that
variable is now out of scope. This was breaking ocaml#485, which produces
variable-for-variable substitutions often. Fortunately,
variable-for-variable substitution under a lambda is also unnecessary
(we already dealt with the free occurrences by making a closure element),
so we can happily just filter out any such bindings.
mshinwell pushed a commit to mshinwell/ocaml that referenced this pull request Jun 30, 2021
PR ocaml#470 propagates substitutions down into lambdas, which works when the
RHS is a constant or symbol but not if it's a variable, since that
variable is now out of scope. This was breaking ocaml#485, which produces
variable-for-variable substitutions often. Fortunately,
variable-for-variable substitution under a lambda is also unnecessary
(we already dealt with the free occurrences by making a closure element),
so we can happily just filter out any such bindings.
mshinwell pushed a commit to mshinwell/ocaml that referenced this pull request Jun 30, 2021
…#514)

PR ocaml#470 propagates substitutions down into lambdas, which works when the
RHS is a constant or symbol but not if it's a variable, since that
variable is now out of scope. This was breaking ocaml#485, which produces
variable-for-variable substitutions often. Fortunately,
variable-for-variable substitution under a lambda is also unnecessary
(we already dealt with the free occurrences by making a closure element),
so we can happily just filter out any such bindings.
lukemaurer added a commit to lukemaurer/ocaml that referenced this pull request Jul 7, 2021
mshinwell pushed a commit to mshinwell/ocaml that referenced this pull request Jul 13, 2021
chambart pushed a commit to chambart/ocaml-1 that referenced this pull request Feb 1, 2022
EmileTrotignon pushed a commit to EmileTrotignon/ocaml that referenced this pull request Jan 12, 2024
EmileTrotignon pushed a commit to EmileTrotignon/ocaml that referenced this pull request Jan 12, 2024
Co-authored-by: tmattio <tmattio@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants