Skip to content

Conversation

mediremi
Copy link
Member

No description provided.

@@ -106,3 +106,12 @@ let null_to_opt e = E.econd (E.is_null e) none (some e)
let undef_to_opt e = E.econd (E.is_undef e) none (some e)

let null_undef_to_opt e = E.econd (E.is_null_undefined e) none (some e)

let option_for_each opt f =
Copy link
Member Author

Choose a reason for hiding this comment

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

Alternative implementation:

  E.econd (is_not_none opt)
    (E.call ~info:(Js_call_info.na_full_call false) f [opt])
    E.unit

Copy link

pkg-pr-new bot commented Aug 24, 2025

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript-lang/rescript@7799

@rescript/darwin-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-arm64@7799

@rescript/darwin-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-x64@7799

@rescript/linux-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-arm64@7799

@rescript/linux-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-x64@7799

@rescript/win32-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/win32-x64@7799

commit: e002775

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.

1 participant