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

Polysemy: intersperse combinator #2767

Merged
merged 7 commits into from
Oct 24, 2022

Conversation

isovector
Copy link
Contributor

This PR implements a new polysemy combinator intersperse which allows for injecting logic between every handled action in the effect stack. It also adds a test-suite to polysemy-wire-zoo, with a new test showing how to use intersperse to poll from an async thread.

The short-term use case for this is to use it to test brig's STOMP client, where we can intersperse the listener callback, which otherwise gets in the way of the removing IO effort.

Checklist

  • Add a new entry in an appropriate subdirectory of changelog.d
  • Read and follow the PR guidelines

@isovector isovector temporarily deployed to cachix October 15, 2022 22:20 Inactive
@isovector isovector temporarily deployed to cachix October 15, 2022 22:20 Inactive
@isovector isovector temporarily deployed to cachix October 16, 2022 16:43 Inactive
@isovector isovector temporarily deployed to cachix October 16, 2022 16:43 Inactive
@isovector isovector temporarily deployed to cachix October 16, 2022 16:45 Inactive
@isovector isovector temporarily deployed to cachix October 16, 2022 16:45 Inactive
Co-authored-by: Igor Ranieri Elland <54423+elland@users.noreply.github.com>
@isovector isovector temporarily deployed to cachix October 20, 2022 17:41 Inactive
@isovector isovector temporarily deployed to cachix October 20, 2022 17:47 Inactive
@elland elland merged commit 91b1be5 into wireapp:develop Oct 24, 2022
elland added a commit that referenced this pull request Oct 24, 2022
* feat: implement intersperse and testing framework

* chore: format

* doc: changelog

* test: add a test showing a simpler use of intersperse

* chore: format

* Update libs/polysemy-wire-zoo/test/Test/IntersperseSpec.hs

Co-authored-by: Igor Ranieri Elland <54423+elland@users.noreply.github.com>

* chore: disable hlint hint

Co-authored-by: Igor Ranieri Elland <54423+elland@users.noreply.github.com>
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