purescript-datetime
purescript-datetime copied to clipboard
Example usage missing in docs
Even a single example of how to construct the main data type in a module would be really helpful.
For example in Data.Time
, you need a lot of understanding and experience to figure out that you're supposed to do something like:
import Data.Enum (toEnum)
myTime2 :: Maybe Time
myTime2 = Time <$> toEnum 11 <*> toEnum 30 <*> toEnum 59 <*> toEnum 213
I didn't have that experience... (Helpful people on #purescript-beginners
Slack suggested the above.)
Would you consider adding that kind of example to the docs?
All of our libraries should have guides (along with better examples). Here are some of my favorites that set a bar to strive for:
- https://github.com/purescript-contrib/purescript-argonaut-codecs/blob/main/docs/README.md
- https://github.com/purescript-halogen/purescript-halogen/tree/master/docs
There's some discussion on a strategy for getting this done across the ecosystem, so we'll try to tackle that here too.
Here's a recent guide written by @dariooddenino https://codingstruggles.com/ps-dates/ Though it would be best for discoverability for guides to incorporated into each library's repo.
Yes, I agree that they would be better if incorporated in the repo. Right now it's there because it was the easiest way for me to have something online and get feedback while I work on it. My dream is still an upgraded version of pursuit that allows for users contributed examples and guides