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

Fix markup errors in and add to Sound.Tidal.UI documentation. #992

Merged
merged 7 commits into from
Mar 9, 2023

Conversation

patrickt
Copy link
Contributor

Hey, folks 👋🏻 I’ve been really loving my TidalCycles experience, and wanted to give something back. Since I’m an experienced Haskeller, I tend to use the Haddocks as my primary source of truth, so I’d like to give them a little more love and port over/write documentation when necessary.

This patch:

  • adds a module header that appears in the Haddocks;
  • ports function descriptions and examples from the main reference documentation;
  • explicates undocumented functions (the ones I could figure out, anyway);
  • engages in minimal reordering of functions for consistency's sake (see the commentary below about explicit export lists for an alternative to this);
  • fixes a lot of errors resulting from Markdown/Haddock inconsistencies;
  • fixes type errors in example code.

There should be no observable change in behavior, as no code has actually changed. I hope to have time to renovate some of the other modules.

Other things I could have done to this module, and would be happy to do now or in a follow-up patch:

  • setting an explicit export list (this would be more work, but would also allow me to customize the order of appearance without actually having to move them in the source);
  • marking deprecated functions/aliases as {-# DEPRECATED #-}, possibly setting the stage for their removal

This patch:
- adds a module header that appears in the Haddocks
- ports some function descriptions from the main reference documentation
- explicates undocumented functions (the ones I could figure out, anyway)
- engages in minimal reordering of functions for consistency's stake
- fixes a lot of errors resulting from Markdown/Haddock inconsistencies

There should be no observable change in behavior, as no code has actually
changed.
@patrickt
Copy link
Contributor Author

Here is a PDF of what the documentation looks like with this patch: Sound.Tidal.UI.pdf.

src/Sound/Tidal/UI.hs Outdated Show resolved Hide resolved
@patrickt
Copy link
Contributor Author

Would a maintainer mind approving the workflows here so this can go green?

Copy link
Contributor

@matthewkaney matthewkaney left a comment

Choose a reason for hiding this comment

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

Thank you so much for this! I'm interested in more overlap between the Haddock docs and the tidalcycles.org docs, so this is a great step in that direction.

(As an aside, I see you're in Queens—if you haven't done anything with livecode.nyc, you totally should!)

'degradeBy' and '_degradeBy'). These functions take plain old data types,
not 'Pattern's, and are mainly useful if you're getting errors about
ambiguous types. In some cases, they may be more efficient than their
equivalents that take 'Pattern' values.
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 always assumed that the underscore variants were essentially internal implementations and not intended for public use. If that's the case, then we shouldn't be encouraging their use, and should eventually exclude them from export lists. @yaxu, is that right, or am I wrong and these variants should be considered part of the public API?

Are there cases where you've run into ambiguous type errors?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If memory serves, I once had enabled perhaps too many {-# LANGUAGE #-} pragmas in the Tidal REPL and got out of it by using an underscore variant. I’m happy to elide this section and just replace it with “the underscore variants are private,” if @yaxu thinks that’s appropriate.

Copy link
Member

Choose a reason for hiding this comment

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

Hm well I think they shouldn't be totally private, as they're useful in writing custom functions. I would say something like, the underscore variants generally only accept plain values and not patterns apart from their final argument, and are intended mainly for those developing or extending tidal.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yaxu Gotcha. I’ve changed the wording to reflect this.

src/Sound/Tidal/UI.hs Outdated Show resolved Hide resolved
src/Sound/Tidal/UI.hs Outdated Show resolved Hide resolved
@yaxu yaxu merged commit 0e9ea27 into tidalcycles:main Mar 9, 2023
@yaxu
Copy link
Member

yaxu commented Mar 9, 2023

Thanks for this and apologies for the long delay !

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.

4 participants