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 std.contract.Sequence #1452

Merged
merged 5 commits into from
Jul 20, 2023
Merged

add std.contract.Sequence #1452

merged 5 commits into from
Jul 20, 2023

Conversation

Radvendii
Copy link
Member

@Radvendii Radvendii commented Jul 13, 2023

This new function isn't so useful for applying directly, but there;s currently no way to store multiple contracts in a variable to be applied later. In other words

'foo | [| 'foo |]

is to

let Foo = [| 'foo |] in
'foo | Foo

as

"foo" | std.contract.TagOrString | [| 'foo |]

is to
???

Well, before there were no options. with this PR we can do

let Foo = std.contract.Sequence [ std.contract.TagOrString, [| 'foo |] ] in
"foo" | Foo

Eventually, it would be nice if the LSP could recognize this and get the same niceties as if you'd directly applied the two contracts.

@github-actions github-actions bot temporarily deployed to pull request July 13, 2023 14:42 Inactive
@Radvendii
Copy link
Member Author

related to #461

Copy link
Contributor

@vkleen vkleen left a comment

Choose a reason for hiding this comment

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

I like it, but I may be biased 😅

core/stdlib/std.ncl Outdated Show resolved Hide resolved
core/stdlib/std.ncl Show resolved Hide resolved
core/stdlib/std.ncl Outdated Show resolved Hide resolved
Radvendii and others added 2 commits July 19, 2023 03:21
Co-authored-by: Viktor Kleen <viktor.kleen@tweag.io>
Co-authored-by: Yann Hamdaoui <yann.hamdaoui@tweag.io>
@github-actions github-actions bot temporarily deployed to pull request July 19, 2023 07:27 Inactive
@github-actions github-actions bot temporarily deployed to pull request July 19, 2023 07:33 Inactive
@Radvendii Radvendii added this pull request to the merge queue Jul 20, 2023
Merged via the queue into master with commit 5002968 Jul 20, 2023
4 checks passed
@Radvendii Radvendii deleted the contract-sequence branch July 20, 2023 08:09
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.

3 participants