Skip to content

Updates library to v0.14.0-rc2 #29

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

Merged
merged 5 commits into from
Oct 11, 2020
Merged

Updates library to v0.14.0-rc2 #29

merged 5 commits into from
Oct 11, 2020

Conversation

JordanMartinez
Copy link
Contributor

Includes #28. Also fixes #23

-- | Create a new mutable reference containing the specified value.
-- |
-- | ## Why This Type Signature Cannot Be `forall s. s -> Ref s`
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer to avoid Markdown subheadings, because it requires us to make assumptions about the markup the compiler generates for API documentation. At the moment each declaration in the module is introduced with an <h3>, but this gives us an <h2>, so we have a larger heading under a smaller one, which is no good.

Regarding the actual content here, beginners will occasionally think that all Ref operations ought to be pure, so I think the fact that most Ref operations have to run in Effect is something that deserves discussing at the top of the module.

Copy link
Contributor

Choose a reason for hiding this comment

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

That is: it will come across a bit strange to devote so much effort to explaining why new specifically is effectful when almost everything in this module is effectful as well and none of the other functions have had the same treatment.

Copy link
Contributor

Choose a reason for hiding this comment

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

If you could split the docs changes into a separate PR we can get this one merged and discuss this further there?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, will do. I should have done it that way in the first place.

@JordanMartinez
Copy link
Contributor Author

I've updated this PR to remove the doc commit and ported it to #30

@JordanMartinez
Copy link
Contributor Author

CI is failing because a test is failing. I'll need to look into this more.

@hdgarrood
Copy link
Contributor

I think there's an infinite loop arising from apply being defined in terms of ap, which now has a Bind constraint rather than a Monad constraint. I'm not sure at first about why this would cause an infinite loop and the previous formulation wouldn't, since it's not really any more cyclical than it used to be.

Copy link
Contributor

@hdgarrood hdgarrood left a comment

Choose a reason for hiding this comment

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

I think the tests should pass now. Would you mind updating psa to 0.8.0 too please? Then I think this is good to merge.

@JordanMartinez
Copy link
Contributor Author

Yup, done!

@JordanMartinez JordanMartinez merged commit 8ab49d5 into purescript:master Oct 11, 2020
@JordanMartinez JordanMartinez deleted the upTo14 branch October 11, 2020 17:49
hdgarrood added a commit that referenced this pull request Oct 13, 2020
See also #23, #29

I thought about this a bit more, and I think the reasoning for why refs
are effectful is more persuasive when viewed through the lens of purity
rather than of referential transparency, so I've updated the docs
accordingly.

I am reluctant to include code examples illustrating why Refs are
effectful here, because I think people may skim the page looking for
code examples, and in the absence of code examples which describe the
real API, I think code examples which illustrate a hypothetical version
of the API which doesn't actually exist may do more harm than good.

I am also leaning towards not including @natefaubion's example (where
you can violate the type system by defining a reference with a
polymorphic type and specializing it after the fact), since it's hard to
illustrate without a code example, and I think it's unlikely to be
useful to most people who just want to make use of the Ref API, which is
the group I think we should be considering to be our target audience
here.
@hdgarrood hdgarrood mentioned this pull request Oct 13, 2020
JordanMartinez pushed a commit that referenced this pull request Oct 13, 2020
See also #23, #29

I thought about this a bit more, and I think the reasoning for why refs
are effectful is more persuasive when viewed through the lens of purity
rather than of referential transparency, so I've updated the docs
accordingly.

I am reluctant to include code examples illustrating why Refs are
effectful here, because I think people may skim the page looking for
code examples, and in the absence of code examples which describe the
real API, I think code examples which illustrate a hypothetical version
of the API which doesn't actually exist may do more harm than good.

I am also leaning towards not including @natefaubion's example (where
you can violate the type system by defining a reference with a
polymorphic type and specializing it after the fact), since it's hard to
illustrate without a code example, and I think it's unlikely to be
useful to most people who just want to make use of the Ref API, which is
the group I think we should be considering to be our target audience
here.
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.

Should we explain why new is effectful in the docs?
4 participants