parallel icon indicating copy to clipboard operation
parallel copied to clipboard

Fix dot documentation

Open treeowl opened this issue 7 years ago • 8 comments

I goofed up and made the strat1 `dot` strat1 = strat1 law too strong. Fix that. Also, add laws for strat `dot` rseq and strat `dot` rpar.

treeowl avatar Jun 04 '18 13:06 treeowl

You are contradicting yourself. In the commit line 308 you say: "strat dot rseq == strat" for all strat, but if strat = r0 it is not.

Diese Nachricht wurde von meinem Android Mobiltelefon mit GMX Mail gesendet.Am 09.06.18, 18:16, David Feuer [email protected] schrieb: @treeowl commented on this pull request.

In Control/Parallel/Strategies.hs:

-- --- > strat2 dot strat1 == strat2 . withStrategy strat1 +-- 'r0', 'rseq', and 'rpar' are all one-sided identities of 'dot': +-- +-- > strat dot r0 == strat +-- > strat dot rseq == strat +-- > strat dot rpar == strat

r0 dot rseq is not r0. But rseq dot r0 = r0.

—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or mute the thread. {"@context":"http://schema.org","@type":"EmailMessage","potentialAction":{"@type":"ViewAction","target":"https://github.com/haskell/parallel/pull/32#discussion_r194232298","url":"https://github.com/haskell/parallel/pull/32#discussion_r194232298","name":"View Pull Request"},"description":"View this Pull Request on GitHub","publisher":{"@type":"Organization","name":"GitHub","url":"https://github.com"}} {"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/haskell/parallel","title":"haskell/parallel","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/haskell/parallel"}},"updates":{"snippets":[{"icon":"PERSON","message":"@treeowl commented on #32"}],"action":{"name":"View Pull Request","url":"https://github.com/haskell/parallel/pull/32#discussion_r194232298"}}} { "@type": "MessageCard", "@context": "http://schema.org/extensions", "hideOriginalBody": "false", "originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB", "title": "@treeowl commented on 32", "sections": [ { "text": "", "activityTitle": "David Feuer", "activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png", "activitySubtitle": "@treeowl", "facts": [

] } ], "potentialAction": [ { "targets": [ { "os": "default", "uri": "https://github.com/haskell/parallel/pull/32#discussion_r194232298" } ], "@type": "OpenUri", "name": "View on GitHub" }, { "name": "Unsubscribe", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n"commandName": "MuteNotification",\n"threadId": 342129584\n}" } ], "themeColor": "26292E" }

Borgvall avatar Jun 09 '18 19:06 Borgvall

I mistyped that comment. It's corrected on the web.

On Sat, Jun 9, 2018, 3:50 PM Johannes Röhl [email protected] wrote:

You are contradicting yourself. In the commit line 308 you say: "strat dot rseq == strat" for all strat, but if strat = r0 it is not.

Diese Nachricht wurde von meinem Android Mobiltelefon mit GMX Mail gesendet.Am 09.06.18, 18:16, David Feuer [email protected] schrieb: @treeowl commented on this pull request.

In Control/Parallel/Strategies.hs:

-- --- > strat2 dot strat1 == strat2 . withStrategy strat1 +-- 'r0', 'rseq', and 'rpar' are all one-sided identities of 'dot': +-- +-- > strat dot r0 == strat +-- > strat dot rseq == strat +-- > strat dot rpar == strat

r0 dot rseq is not r0. But rseq dot r0 = r0.

—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or mute the thread. {"@context":"http://schema.org ","@type":"EmailMessage","potentialAction":{"@type":"ViewAction","target":" https://github.com/haskell/parallel/pull/32#discussion_r194232298","url":" https://github.com/haskell/parallel/pull/32#discussion_r194232298","name":"View Pull Request"},"description":"View this Pull Request on GitHub","publisher":{"@type":"Organization","name":"GitHub","url":" https://github.com"}} {"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/haskell/parallel","title":"haskell/parallel","subtitle":"GitHub repository","main_image_url":" https://assets-cdn.github.com/images/email/message_cards/header.png ","avatar_image_url":" https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/haskell/parallel"}},"updates":{"snippets":[{"icon":"PERSON","message":"@treeowl commented on #32"}],"action":{"name":"View Pull Request","url":" https://github.com/haskell/parallel/pull/32#discussion_r194232298"}}} { "@type": "MessageCard", "@context": "http://schema.org/extensions", "hideOriginalBody": "false", "originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB", "title": "@treeowl commented on 32", "sections": [ { "text": "", "activityTitle": "David Feuer", "activityImage": " https://assets-cdn.github.com/images/email/message_cards/avatar.png", "activitySubtitle": "@treeowl", "facts": [

] } ], "potentialAction": [ { "targets": [ { "os": "default", "uri": "https://github.com/haskell/parallel/pull/32#discussion_r194232298" } ], "@type": "OpenUri", "name": "View on GitHub" }, { "name": "Unsubscribe", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n"commandName": "MuteNotification",\n"threadId": 342129584\n}" } ], "themeColor": "26292E" }

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/haskell/parallel/pull/32#issuecomment-395994295, or mute the thread https://github.com/notifications/unsubscribe-auth/ABzi_QAA8CwmZzijHI6DlZ91wjF05WO_ks5t7CcGgaJpZM4UZHuw .

treeowl avatar Jun 09 '18 20:06 treeowl

In the edited version of your comment you sai: "r0 dot rseq is not r0", but in line 308 you say:

-- strat `dot` rseq == strat [for all strat even r0]

So you are still contradicting yourself.

Borgvall avatar Jun 10 '18 09:06 Borgvall

Yes, I did make a mistake. r0 `dot` rseq is indeed r0 after all.

treeowl avatar Jun 10 '18 11:06 treeowl

@treeowl can I let you merge it?

Kleidukos avatar Jan 19 '24 15:01 Kleidukos

@treeowl can I let you merge it?

I don't understand the question. I don't have permission to merge things to master.

treeowl avatar Jan 19 '24 16:01 treeowl

As this old merge request has been resurrected, I revisited it. My current point of view is, that the documentation is as weird as the implementation of dot, and the documentation changes of @treeowl simply expose this fact.

IMHO the dotcombinator should be deprecated. The reasonable way to "compose two strategies sequentially" is to use Control.Monad.>=>.

Borgvall avatar Jan 19 '24 17:01 Borgvall

I agree that r0 `dot` rseq == `r0 is counterintuitive. >=>/<=< indeed gives you a more intuitive (IMO) strategy composition, e.g. r0 <=< rseq == rseq.

We should definitely fix the documentation (although there's still an unresolved review), but I'm sympathetic to deprecating dot, unless someone has an argument why this strategy composition makes sense.

konsumlamm avatar Jan 20 '24 01:01 konsumlamm