Skip to content

refactor: use effect syntax from OCaml 5.3#33

Open
favonia wants to merge 1 commit into
mainfrom
ocaml5.3
Open

refactor: use effect syntax from OCaml 5.3#33
favonia wants to merge 1 commit into
mainfrom
ocaml5.3

Conversation

@favonia

@favonia favonia commented Sep 28, 2024

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread src/State.ml
| effect Set v, k -> st := v; continue k ()

let try_with ?(get=get) ?(set=set) f =
let open Effect.Deep in

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is open Effect.Deep needed anymore?

@favonia favonia Oct 2, 2024

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonsterling Yes. See ocaml/ocaml#13511 for my Thought on this.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, that is a very nice Thought.

@favonia favonia Oct 2, 2024

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonsterling It's also why we have these two helper functions:

https://github.com/RedPRL/algaeff/blob/main/src/Fun.ml

It will be great if the compiler can do it directly, avoiding the overhead of creating stupid closures.

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