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

Update docs for parse to discourage its use #25

Merged

Conversation

maxdeviant
Copy link
Member

As discussed in #15, this PR updates the docs for parse to discourage its use.

@@ -150,8 +150,11 @@ foreign import dateMethod :: forall a. Fn2 String JSDate a

-- | Attempts to parse a date from a string. The behaviour of this function is
-- | implementation specific until ES5, so may not always have the same
-- | behaviour for a given string. The RFC2822 and ISO8601 date string formats
Copy link
Member Author

Choose a reason for hiding this comment

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

behaviourbehavior

Does PureScript have any language-level conventions on spelling?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not aware of any conventions; both British / American English variants appear in various places. I don't mind which one is used here, but if we switch this behaviour -> behavior then we should adjust the one two lines up as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch!

@maxdeviant
Copy link
Member Author

This is my first stab at rewording the docs.

Let me know if we want to include more information (perhaps mentioning a date parsing library to use as an alternative?) or if tweaks to the wording are needed.

-- | behaviour for a given string. The RFC2822 and ISO8601 date string formats
-- | should parse consistently.
-- | behavior for a given string. For this reason, it is **strongly** encouraged
-- | that you avoid this function if at all possible.
Copy link
Contributor

Choose a reason for hiding this comment

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

We could add "and instead use functions from a higher-level library like datetime" but I'll defer to @hdgarrood on his preferred wording.

Copy link
Contributor

Choose a reason for hiding this comment

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

This seems fine to me 👍

@thomashoneyman thomashoneyman merged commit 95887bd into purescript-contrib:main Dec 10, 2020
@thomashoneyman thomashoneyman mentioned this pull request Dec 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants