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

Add Condition to Eio.Std #580

Open
anmonteiro opened this issue Jul 11, 2023 · 3 comments
Open

Add Condition to Eio.Std #580

anmonteiro opened this issue Jul 11, 2023 · 3 comments
Labels
api API design decision enhancement New feature or request

Comments

@anmonteiro
Copy link
Contributor

  • If I'm opening Eio.Std I'm most likely buying in to the Eio abstractions
  • Just like I expected to use Promise or Switch, I usually start typing Condition.* only to find out it's the Stdlib Condition module

I propose adding the Condition module to Eio.Std to avoid the ambiguity.

@talex5
Copy link
Collaborator

talex5 commented Jul 12, 2023

I'm not very keen on that, since it does indeed shadow the stdlib module, which might be confusing.

@SGrondin
Copy link
Collaborator

SGrondin commented Jul 12, 2023

At the moment I don't often open Eio.Std because I have to type "Eio." for ~90% of the Eio function calls I make anyway (Eio.Flow.*, Eio.Stream.*, Eio.Path.*, etc).

open Eio.Std is most useful for traceln, but during development I'm continuously adding and removing traceln calls while debugging, and since it's often the only usage of Eio.Std, it leads to intermittent and distracting warnings about an unused open.

I might change my workflow and start using open! instead.

To be clear, I'm not advocating for a change of direction in Eio.Std. I definitely see the advantages in the current direction. But I thought I should share this (minor) annoyance I deal with everyday in case it's useful to you all!

@talex5
Copy link
Collaborator

talex5 commented Jul 12, 2023

One other possibility: you can add (flags (:standard -open Eio.Std)) in your dune file to open it for all modules. I only don't do that because it might confuse people copying my code as an example.

@talex5 talex5 added enhancement New feature or request api API design decision labels Jul 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api API design decision enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants