Skip to content

Make atdgen -v produce constructors whose label do not contain "field_prefix" #433

@kit-ty-kate

Description

@kit-ty-kate

If we take the following example atd file:

type new_pull = { 
  title: string;
  ?body: string option;
  base: string;
  head: string;
} <ocaml field_prefix="new_pull_">

and want to get the "constructor" (create_new_pull function) using atdgen -v, we will get the following function:

val create_new_pull :
  new_pull_title: string ->
  ?new_pull_body: string ->
  new_pull_base: string ->
  new_pull_head: string ->
  unit -> new_pull
  (** Create a record of type {!type:new_pull}. *)

Instead i would've expected the following more concise version:

val create_new_pull :
  title: string ->
  ?body: string ->
  base: string ->
  head: string ->
  unit -> new_pull
  (** Create a record of type {!type:new_pull}. *)

I'm fairly new to atdgen so maybe i'm missing some known option or attribute to be able to get the right version that i wasn't able to find in the documentation.


Atdgen version: 2.16.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions