Logs: freenode/#haskell
| 2020-10-20 18:48:30 | → | GyroW joins (~GyroW@d54C03E98.access.telenet.be) |
| 2020-10-20 18:48:30 | × | GyroW quits (~GyroW@d54C03E98.access.telenet.be) (Changing host) |
| 2020-10-20 18:48:30 | → | GyroW joins (~GyroW@unaffiliated/gyrow) |
| 2020-10-20 18:49:35 | <ski> | so you define `f =< g' to mean `forall y. (exists x. f x = y) => (exists x. g x = y)' ? |
| 2020-10-20 18:52:25 | × | djellemah quits (~djellemah@2601:5c2:100:96c:e008:b638:39fe:6a54) (Quit: Leaving) |
| 2020-10-20 18:53:17 | × | shafox quits (~shafox@106.51.234.111) (Remote host closed the connection) |
| 2020-10-20 18:55:16 | <frdg> | ski: You mean `=<` as less or equal right? |
| 2020-10-20 18:55:41 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-10-20 18:56:34 | × | invaser quits (~Thunderbi@31.148.23.125) (Ping timeout: 272 seconds) |
| 2020-10-20 18:56:45 | × | GyroW quits (~GyroW@unaffiliated/gyrow) (Ping timeout: 240 seconds) |
| 2020-10-20 18:56:54 | → | GyroW_ joins (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be) |
| 2020-10-20 18:56:54 | × | GyroW_ quits (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be) (Changing host) |
| 2020-10-20 18:56:54 | → | GyroW_ joins (~GyroW@unaffiliated/gyrow) |
| 2020-10-20 18:58:28 | hackage | parsek 1.0.3.0 - Parallel Parsing Processes https://hackage.haskell.org/package/parsek-1.0.3.0 (JeanPhilippeBernardy) |
| 2020-10-20 18:58:34 | <frdg> | ski: to me this definition would be for equality of functions. |
| 2020-10-20 18:59:50 | <merijn> | hmm |
| 2020-10-20 18:59:59 | <merijn> | Why is there no foldMapM? :\ |
| 2020-10-20 19:01:30 | <kuribas> | foldTraverse? |
| 2020-10-20 19:01:41 | <monochrom> | Since M is involved, order matters now. Should foldMapM mean left to right? right to left? top down? bottom up? |
| 2020-10-20 19:01:56 | <merijn> | monochrom: eh |
| 2020-10-20 19:02:07 | <merijn> | monochrom: That matters for monoids too |
| 2020-10-20 19:02:17 | <merijn> | monochrom: So that's a bit of a non argument |
| 2020-10-20 19:02:28 | × | babygnu quits (~robert@gateway/tor-sasl/babygnu) (Remote host closed the connection) |
| 2020-10-20 19:02:40 | <kuribas> | left to right |
| 2020-10-20 19:02:55 | → | babygnu joins (~robert@gateway/tor-sasl/babygnu) |
| 2020-10-20 19:03:03 | <merijn> | monochrom: Exhibit A: Alt |
| 2020-10-20 19:03:31 | → | berberman_ joins (~berberman@unaffiliated/berberman) |
| 2020-10-20 19:04:00 | <phadej> | :t Control.MOnad.foldM |
| 2020-10-20 19:04:02 | <lambdabot> | error: |
| 2020-10-20 19:04:02 | × | berberman quits (~berberman@unaffiliated/berberman) (Ping timeout: 260 seconds) |
| 2020-10-20 19:04:03 | <lambdabot> | Not in scope: ‘Control.MOnad.foldM’ |
| 2020-10-20 19:04:03 | <lambdabot> | Perhaps you meant one of these: |
| 2020-10-20 19:04:05 | <phadej> | :t Control.Monad.foldM |
| 2020-10-20 19:04:07 | <lambdabot> | (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b |
| 2020-10-20 19:04:19 | <merijn> | monochrom: Perhaps you were thinking of commutative monoids? :p |
| 2020-10-20 19:04:27 | <monochrom> | No. |
| 2020-10-20 19:04:27 | → | britva joins (~britva@31-10-157-156.cgn.dynamic.upc.ch) |
| 2020-10-20 19:04:38 | <merijn> | phadej: Yeah, but then I need to write an awkward wrapper :\ |
| 2020-10-20 19:04:45 | <phadej> | (a <> b) <> c = a <> (b <> c) |
| 2020-10-20 19:04:59 | <phadej> | if <> would "print" something, these will sequence effects in different order |
| 2020-10-20 19:05:27 | hackage | parsek 1.0.4.0 - Parallel Parsing Processes https://hackage.haskell.org/package/parsek-1.0.4.0 (JeanPhilippeBernardy) |
| 2020-10-20 19:05:29 | <phadej> | but if you don't care, then foldMapM would just work |
| 2020-10-20 19:05:55 | × | taurux quits (~taurux@net-130-25-120-210.cust.vodafonedsl.it) (Ping timeout: 265 seconds) |
| 2020-10-20 19:06:12 | <phadej> | looks like rio and relude define foldMapM |
| 2020-10-20 19:06:16 | <merijn> | phadej: But that doesn't hold for "(Monad m, Monoid r) => (a -> m r) -> [a] -> m r" |
| 2020-10-20 19:06:26 | <merijn> | phadej: <> can't have an effect there |
| 2020-10-20 19:06:40 | <merijn> | phadej: That's just Alt/liftA2 (<>) |
| 2020-10-20 19:06:41 | <monochrom> | Data.Foldable.foldlM and foldrM |
| 2020-10-20 19:06:47 | × | leah2 quits (~leah@vuxu.org) (Ping timeout: 244 seconds) |
| 2020-10-20 19:06:47 | → | taurux joins (~taurux@net-93-146-7-193.cust.vodafonedsl.it) |
| 2020-10-20 19:06:53 | <phadej> | merijn: there you can still can traverse in arbitrary order |
| 2020-10-20 19:06:55 | <merijn> | both of which have perfectly well defined semantics |
| 2020-10-20 19:06:55 | → | tnm joins (~tnm@dslb-084-056-234-071.084.056.pools.vodafone-ip.de) |
| 2020-10-20 19:06:59 | <phadej> | but I guess you'd expect `traverse` order |
| 2020-10-20 19:07:05 | <merijn> | phadej: Yes, but the traversal order also impacts the monoid |
| 2020-10-20 19:07:20 | → | ensyde joins (~ensyde@2600:1702:2e30:1a40:c919:4da8:ba88:82fd) |
| 2020-10-20 19:07:31 | <merijn> | The order of traversal matters for foldMap *anyway* |
| 2020-10-20 19:07:41 | <phadej> | :t \f -> fmap fold . traverse f |
| 2020-10-20 19:07:43 | <lambdabot> | (Monoid b, Traversable t, Applicative f) => (a -> f b) -> t a -> f b |
| 2020-10-20 19:07:44 | <merijn> | So the fact that it matters for foldMapM is trivial |
| 2020-10-20 19:07:50 | <merijn> | Of course it does |
| 2020-10-20 19:07:50 | <monochrom> | Not that order. The other order. |
| 2020-10-20 19:08:16 | <phadej> | fmapTraverse should be a member of `Traversable` |
| 2020-10-20 19:08:25 | <phadej> | \f g -> fmap f . traverse g |
| 2020-10-20 19:08:26 | <phadej> | :t \f g -> fmap f . traverse g |
| 2020-10-20 19:08:27 | hackage | flashblast 0.0.4.0 - Generate language learning flashcards from video. https://hackage.haskell.org/package/flashblast-0.0.4.0 (locallycompact) |
| 2020-10-20 19:08:28 | <lambdabot> | (Traversable t, Applicative f) => (t b1 -> b2) -> (a -> f b1) -> t a -> f b2 |
| 2020-10-20 19:08:37 | × | elliott__ quits (~elliott@pool-108-51-141-12.washdc.fios.verizon.net) (Ping timeout: 264 seconds) |
| 2020-10-20 19:09:17 | × | knupfer quits (~Thunderbi@200116b82c27b200ad7c9ffd9ebcfe8b.dip.versatel-1u1.de) (Ping timeout: 260 seconds) |
| 2020-10-20 19:09:18 | <merijn> | monochrom: Please show me how the traversal order "doesn't matter" for "Just . First" :) |
| 2020-10-20 19:10:04 | <phadej> | it doesn't matter, Maybe is commutative effect |
| 2020-10-20 19:10:22 | <merijn> | phadej: eh, it does... |
| 2020-10-20 19:10:28 | <merijn> | phadej: You get a different value |
| 2020-10-20 19:10:42 | <phadej> | you don't |
| 2020-10-20 19:11:10 | <monochrom> | evaluation order and confluence, vs execution order and effects? |
| 2020-10-20 19:11:13 | <phadej> | yes |
| 2020-10-20 19:11:19 | <monochrom> | Must I spell it out? |
| 2020-10-20 19:11:29 | <phadej> | no, let's just stop |
| 2020-10-20 19:11:41 | <phadej> | \f -> fmap fold . traverse f -- is what merijn wants |
| 2020-10-20 19:11:56 | <merijn> | Given a datatype "Foo a" the result of both foldMap and hypothetical foldMapM is dependent on the traversal order of Foo, yes or no? |
| 2020-10-20 19:12:12 | × | ensyde quits (~ensyde@2600:1702:2e30:1a40:c919:4da8:ba88:82fd) (Ping timeout: 260 seconds) |
| 2020-10-20 19:12:25 | <phadej> | https://gitlab.haskell.org/ghc/ghc/-/issues/13153 looks like I'm not the only one who wants mapTraverse |
| 2020-10-20 19:13:06 | <phadej> | merijn: ... |
| 2020-10-20 19:13:41 | × | conal_ quits (~conal@66.115.157.40) (Quit: Computer has gone to sleep.) |
| 2020-10-20 19:14:15 | × | tnm quits (~tnm@dslb-084-056-234-071.084.056.pools.vodafone-ip.de) (Quit: leaving) |
| 2020-10-20 19:14:17 | <phadej> | monochrom meant that if "Foo" is a tree, foldMap can reassosiate the <>, and that shouldn't matter for the end result |
| 2020-10-20 19:14:40 | <phadej> | as in, foldMap implementation may use associativity of <> to its advantage |
| 2020-10-20 19:14:44 | <merijn> | phadej: Well my type only admits the Alt monoid in which case it *doesn't* matter |
| 2020-10-20 19:15:00 | <phadej> | but that's different "order" then traverse-ing |
| 2020-10-20 19:15:21 | → | tnm joins (~tnm@dslb-084-056-234-071.084.056.pools.vodafone-ip.de) |
| 2020-10-20 19:15:34 | × | bartemius quits (~bartemius@109.252.19.142) (Remote host closed the connection) |
| 2020-10-20 19:15:39 | <merijn> | phadej: I'm trying to determine where the asssumptions diverge that leads to monochrom disagreeing. |
| 2020-10-20 19:15:55 | <merijn> | afaict the type I want only admits the Alt implementation in which case reassociating <> is irrelevant |
| 2020-10-20 19:15:59 | <phadej> | internet, where people disagree just because |
| 2020-10-20 19:16:19 | <merijn> | (well, that's a lie I guess it also admits the dual of Alt) |
| 2020-10-20 19:16:40 | <merijn> | Either way, reassociating of <> doesn't affect the result, effects or no |
| 2020-10-20 19:16:57 | × | britva quits (~britva@31-10-157-156.cgn.dynamic.upc.ch) (Quit: This computer has gone to sleep) |
| 2020-10-20 19:17:38 | <monochrom> | So you don't need a general polymorphic function that covers all Foldable instances. |
| 2020-10-20 19:17:40 | <merijn> | So only the traversal order has an impact on the behaviour of effects, but that has effect on <> anyway |
| 2020-10-20 19:18:28 | → | conal joins (~conal@64.71.133.70) |
All times are in UTC.