Skip to content

Add group functions #42

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 4 commits into from
Oct 8, 2023
Merged

Add group functions #42

merged 4 commits into from
Oct 8, 2023

Conversation

pete-murphy
Copy link
Contributor

@pete-murphy pete-murphy commented Oct 4, 2023

Description of the change

Fixes #41. This adds group, groupCollapsed, and groupEnd functions. See MDN Using groups in the console.


Checklist:

  • Added the change to the changelog's "Unreleased" section with a reference to this PR (e.g. "- Made a change (#0000)")
  • Linked any existing issues or proposals that this pull request should close
  • Updated or added relevant documentation
  • Added a test for the contribution (if applicable)

@pete-murphy pete-murphy marked this pull request as ready for review October 4, 2023 13:24
@garyb
Copy link
Member

garyb commented Oct 4, 2023

Maybe we could add something along the lines of this too:

grouped :: forall m a. MonadEffect m => String -> m a -> m a
grouped name inner = do
  group name
  result <- inner
  groupEnd
  pure result

@pete-murphy
Copy link
Contributor Author

Maybe we could add something along the lines of this too:

I'd be happy to add that in with these changes, could get to it later today.

Comment on lines +81 to +83
-- | Perform an effect within the context of an inline group in the console.
-- | Calls `group` and `groupEnd` before and after the effect, respectively.
grouped :: forall a. String -> Effect a -> Effect a
Copy link
Contributor Author

@pete-murphy pete-murphy Oct 4, 2023

Choose a reason for hiding this comment

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

Assuming we also want the Effect version I added here, in addition to the MonadEffect type suggested above?

Copy link
Member

Choose a reason for hiding this comment

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

May as well 😄. Thanks!

@garyb garyb merged commit 3a0cf2e into purescript:master Oct 8, 2023
@garyb
Copy link
Member

garyb commented Oct 8, 2023

Released as v6.1.0 🙂

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.

Missing group/groupCollapsed/groupEnd
2 participants