Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

group string_to string_of functions into record #416

Open
ygrek opened this issue Dec 10, 2024 · 1 comment
Open

group string_to string_of functions into record #416

ygrek opened this issue Dec 10, 2024 · 1 comment
Assignees

Comments

@ygrek
Copy link
Contributor

ygrek commented Dec 10, 2024

this will help consumers to write generic code where this pair of functions can be passed around (it is ofc possible to do now just more verbose and annoying)

@smondet
Copy link

smondet commented Jan 2, 2025

Instead of a record why not a generate a submodule:

module Type_name = struct
  type t = type_name
  let of_string = type_name_of_string
  (* etc ...*)
end
  • can still be used as a record (first class module)
    • in that case the modules are structurally typed so no need to share a
      record type with ATD libs from code using that feature
  • can also be more easily used as a common functor argument

@smondet smondet self-assigned this Jan 3, 2025
smondet added a commit that referenced this issue Jan 3, 2025
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

No branches or pull requests

2 participants