Skip to content

Implements Semigroup / Monoid instances for Ur#461

Merged
aspiwack merged 1 commit intotweag:masterfrom
konn:konn/monoid-semigroup-ur
Aug 28, 2023
Merged

Implements Semigroup / Monoid instances for Ur#461
aspiwack merged 1 commit intotweag:masterfrom
konn:konn/monoid-semigroup-ur

Conversation

@konn
Copy link
Copy Markdown
Contributor

@konn konn commented Aug 26, 2023

Description

This PR adds linear Semigroup and Monoid instances for Ur, which turns unrestricted ones into linear ones.

Motivation

This instance is particuarly useful when one extract unrestricted monoidal value out of linear values; e.g. foldMap of Pull and/or Push Arrays.
I used them to test my custom vector-generic fromVector for pull arrays without allocating vector (corresponding instance definition)

@konn konn changed the title Semigroup / Monoid instances for Ur Implements Semigroup / Monoid instances for Ur Aug 26, 2023
Copy link
Copy Markdown
Member

@aspiwack aspiwack 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!

@aspiwack aspiwack merged commit 5802786 into tweag:master Aug 28, 2023
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.

2 participants