question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Relax the generation of `t_n`

See original GitHub issue

ts2ocaml generates types for all of the arrity possible of a given type.

However, in practice, the types are stricly equal and have the same arrity as the type t.

Additionnally, bindings generated seem to always use the type with highest arrity.

So I would propose that:

  • We don’t generate types if they have the same arrity as t
  • (optionnally), we only generate t as it seems compatible with how other generated bindings will use the module.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
cannorincommented, Sep 16, 2021

Now we have an option --safe-arity to customize this behavior since https://github.com/ocsigen/ts2ocaml/commit/1f0ed1e771133424fed0ad855f0f58b9831128ca .

  • --safe-arity=full (default) generates t_n types in the module, and tries to use t_n type if the type is unknown (e.g. from another package)
  • --safe-arity=provide only generates t_n types in the module
  • --safe-arity=consume only tries to use t_n type if the type is unknown
  • --safe-arity=off disables any usage of t_n types
0reactions
cannorincommented, Sep 17, 2021

The above was addressed in https://github.com/ocsigen/ts2ocaml/commit/22191ab2220cbfeb1b0d7244650195934c4eafc4 (in fact, --safe-arity=off didn’t generate necessary t_n types at all)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Hamilton County Schools unveils first calm room for ...
Students at Chattanooga School for the Liberal Arts will now have a place to relax and reset thanks to a new calm room...
Read more >
2GEN ANNUAL REPORT
Two-generation approaches can be found along a continuum. The graphic below illustrates the starting point (parent or child) and the relative emphasis. Whole- ......
Read more >
How a first-gen University of Tennessee veteran helps ...
How a first-gen University of Tennessee veteran helps others get past 'hard days'. Becca Wright. Knoxville News Sentinel.
Read more >
Next Generation Movers, LLC | Nashville TN
Leave the heavy lifting to us, so you can focus on having a safe and relaxing move. nextgenerationmovers@gmail.com (615) 218-4633 www.nextgenerationmovers.com
Read more >
Where To Relax In Nashville
Revel in Nashville's state of the art, full-spectrum infrared sauna and float therapy destination -- furnishing both mental and physical relaxation, weight loss ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found