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 examples for all library functions #5

Closed
dsyme opened this issue Jul 15, 2020 · 5 comments
Closed

Add examples for all library functions #5

dsyme opened this issue Jul 15, 2020 · 5 comments

Comments

@dsyme
Copy link
Contributor

dsyme commented Jul 15, 2020

This was suggested in the F# community dugnad today

@dsyme
Copy link
Contributor Author

dsyme commented Jul 15, 2020

One way to approach this is to add examples directly to the FSHarp.Core signature files, e.g. https://github.com/dotnet/fsharp/blob/master/src/fsharp/FSharp.Core/array2.fsi

There are pros and cons to doing this and you might that find that on your first PR to submit examples there is a discussion with the dotnet/fsharp engineers about whether this is the right place for examples to live.

Pro: right at the core of the ecosystem
Con: it takes a really long time for examples to flow through to generated docs because a new FSharp.Core is needed

Therefore we need a way to mix these examples in on an earlier path

@yvern
Copy link

yvern commented Jul 15, 2020

Another kind of useful documentation/examples is using tests, as having "trivial" use cases of library functions tested, and have a way to look for these to insert as examples in final documentation, which doubles as consistency checks on api

@baronfel
Copy link
Collaborator

Just a note that the Con above might be mitigated somewhat by generating these docs from a self-built version of FSharp.Core, or pulled from a nightly feed or such. We just need the dll + associated XML file to generate the docs, and we've just defaulted to nuget for ease of acquisition.

@dsyme
Copy link
Contributor Author

dsyme commented Jul 19, 2020

Yup agreed

@dsyme
Copy link
Contributor Author

dsyme commented Oct 11, 2021

This is being tracked in dotnet/fsharp#12124

@dsyme dsyme closed this as completed Oct 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants