Skip to content

Fix monoid instance for consumer. - #181

Open
robinp wants to merge 1 commit into
haskell-works:mainfrom
robinp:fix-prop
Open

Fix monoid instance for consumer.#181
robinp wants to merge 1 commit into
haskell-works:mainfrom
robinp:fix-prop

Conversation

@robinp

@robinp robinp commented Sep 26, 2021

Copy link
Copy Markdown

Commit mode needs wrapping with Maybe, otherwise it can be
unintentionally be reverted to the default async.

Commit mode needs wrapping with Maybe, otherwise it can be
unintentionally be reverted to the default async.
@robinp

robinp commented Sep 26, 2021

Copy link
Copy Markdown
Author

Slightly related to #175, fixing the surprising monoid behavior.

(ConsumerProperties m1 ll1 cb1 _) <> (ConsumerProperties m2 ll2 cb2 cup2) =
ConsumerProperties (M.union m2 m1) (ll2 `mplus` ll1) (cb1 `mplus` cb2) cup2
(ConsumerProperties m1 ll1 cb1 cup1) <> (ConsumerProperties m2 ll2 cb2 cup2) =
ConsumerProperties (M.union m2 m1) (ll2 `mplus` ll1) (cb1 `mplus` cb2) (cup1 `mplus` cup2)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shouldn't it be (cup2 `mplus` cup1) instead? Otherwise it'll be impossible to override once set...

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