00:07:16  * keith_millerjoined
00:19:28  * michaelficarraquit (Quit: michaelficarra)
00:36:11  * gibson042quit (Quit: Leaving.)
00:38:31  * aki_joined
00:39:13  * akirosequit (Ping timeout: 244 seconds)
00:39:13  * aki_changed nick to akirose
00:45:02  * keith_millerquit (Quit: My MacBook has gone to sleep. ZZZzzz…)
00:48:33  * keith_millerjoined
00:50:32  * keith_m__joined
00:53:47  * keith_millerquit (Ping timeout: 240 seconds)
00:58:19  * rmarkinsjoined
01:02:33  * rmarkinsquit (Ping timeout: 245 seconds)
01:11:46  * keith_m__quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
01:12:15  * keith_millerjoined
01:51:20  * keith_millerquit (Quit: My MacBook has gone to sleep. ZZZzzz…)
01:52:28  * keith_millerjoined
01:53:39  * rmarkinsjoined
01:56:15  * rmarkins_joined
01:59:52  * keith_millerquit (Quit: My MacBook has gone to sleep. ZZZzzz…)
01:59:54  * rmarkinsquit (Ping timeout: 246 seconds)
02:00:39  * rmarkins_quit (Ping timeout: 250 seconds)
02:13:55  * keith_millerjoined
02:18:21  * keith_m__joined
02:20:53  * keith_millerquit (Ping timeout: 245 seconds)
02:31:36  * keith_m__quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
02:44:47  * aki_joined
02:45:26  * akirosequit (Ping timeout: 240 seconds)
02:45:27  * aki_changed nick to akirose
02:54:54  * kilroyjoined
02:56:10  * kilroyquit (Client Quit)
02:56:57  * h11joined
02:57:50  * jxintangjoined
03:01:26  * jwaldenquit (Quit: ChatZilla 0.9.92-rdmsoft [XULRunner 35.0.1/20150122214805])
03:08:27  * cloudshuquit (Quit: Connection closed for inactivity)
03:18:27  * jridgewellquit (Quit: Connection closed for inactivity)
03:32:07  * jxintangquit (Ping timeout: 256 seconds)
03:41:16  * jridgewelljoined
03:52:59  * keith_millerjoined
03:59:18  <devsnek>if ecma262 had multipage
03:59:41  <devsnek>should it be implemented in ecmarkup or by processing the output
04:03:06  * flibbquit (Remote host closed the connection)
04:06:16  <Sirisian>Definitely as part of ecmarkup. That could change whenever. That said what would be the goal?
04:10:17  <devsnek>Sirisian: size and performance
04:10:31  <devsnek>my cpu stays pinned around 50% just having the spec open
04:10:37  <devsnek>can't even open it on my phone
04:10:43  <devsnek>lots of people have similar issues
04:12:50  * keith_millerquit (Quit: My MacBook has gone to sleep. ZZZzzz…)
04:13:12  <Sirisian>I've only started looking at ecmarkup and it's various utility programs. Is it using real web components?
04:15:12  <Sirisian>They look real. nvm. Was thinking maybe it could be a polyfill thing. My computer is too fast to notice things.
04:29:10  <Sirisian>devsnek, Did you try profiling it? I noticed that "Hit Test"s take a while on the page. https://bugs.chromium.org/p/chromium/issues/detail?id=428083
04:29:42  <devsnek>Sirisian: its roughly 800 pages long
04:29:45  <devsnek>its just really big
04:29:47  <bterlson>Sirisian: it used to be a "real" web component thing, but rendering the giant document was extremely slow
04:29:58  <bterlson>like, minutes to load slow
04:30:20  <bterlson>so now the elements are preprocessed away, but nothing is stopping osmeone from making a CE implementation AFAIK
04:30:25  <bterlson>might be nice for small specs?
04:33:37  <Sirisian>It would be naive, but hiding the different sections might be enough. It looks like hit tests are ran for every scroll/mouse move. Also the spec runs 100% fine on my old HTC 10?
04:34:02  <Sirisian>There's absolutely no lag.
04:38:32  * Sirisian_joined
04:41:56  * Sirisianquit (Ping timeout: 246 seconds)
04:43:33  * cloudshujoined
04:45:07  * Justineojoined
04:45:07  * Havvyquit (Read error: Connection reset by peer)
04:46:52  * Justineoquit (Client Quit)
04:49:53  * Havvyjoined
04:51:49  * aki_joined
04:52:08  * akirosequit (Ping timeout: 245 seconds)
04:52:08  * aki_changed nick to akirose
05:00:28  * Sirisian_part
05:00:38  * Sirisianjoined
05:01:12  * rmarkinsjoined
05:08:13  * rmarkinsquit (Ping timeout: 268 seconds)
05:08:24  * flibbjoined
05:12:43  * gibson042joined
05:23:39  * gibson042quit (Ping timeout: 268 seconds)
05:24:59  <Bakkot>Sirisian: are you using Firefox? I've noticed the spec render smuch quicker in FF than Chrome
05:29:12  <Sirisian>I use both, but on mobile I use Chrome.
05:29:43  <Sirisian>I just noticed in Chrome the spec is so large you can't debug it. Only profile, but firefox can debug it.
05:38:14  * gibson042joined
05:45:00  * jmdyckquit (Remote host closed the connection)
05:56:28  <devsnek>its surprisingly easy to parse the spec into json
05:56:39  <devsnek>my compliments to the good structure of the build output
06:30:23  <ljharb>ftr it works super fast in safari, which is the only place i've ever looked at it :-p
06:58:06  * aki_joined
06:58:20  * akirosequit (Ping timeout: 250 seconds)
06:58:22  * aki_changed nick to akirose
07:03:31  * flibbquit (Remote host closed the connection)
07:05:49  * rmarkinsjoined
07:11:18  * rmarkinsquit (Ping timeout: 245 seconds)
07:15:30  * keith_millerjoined
07:28:27  * jridgewellquit (Quit: Connection closed for inactivity)
07:35:40  * keith_millerquit (Quit: My MacBook has gone to sleep. ZZZzzz…)
07:53:06  <Jessidhia>Scala also uses = to indicate function implementations, it's just that most of the time that implementation is a block statement
08:05:44  * keith_millerjoined
08:10:42  <annevk>So https://tc39.github.io/ecma262/#sec-object-type only talks about get/set access to properties; but then there's also prose to the extent of "If O has an own property P"
08:12:26  <annevk>Context: https://github.com/heycam/webidl/pull/601
08:30:25  * Jessidhiaquit (Ping timeout: 244 seconds)
08:30:36  * Jessidhi_joined
08:32:21  * Jessidhi_part
08:32:33  * Jessidhiajoined
09:04:52  * aki_joined
09:04:56  * akirosequit (Ping timeout: 240 seconds)
09:05:05  * aki_changed nick to akirose
09:35:21  * Jessidhiaquit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:36:35  * Jessidhiajoined
10:10:31  * sendilkumarnjoined
10:12:28  * sendilkumarn_joined
10:14:11  * cloudshuquit (Quit: Connection closed for inactivity)
10:16:43  * sendilkumarn_quit (Ping timeout: 256 seconds)
10:17:10  <sendilkumarn>Hello Everybody :) Thanks for the invite @bterlson (in twitter)
10:41:39  * sendilkumarnquit (Remote host closed the connection)
10:44:41  * keith_millerquit (Quit: My MacBook has gone to sleep. ZZZzzz…)
10:45:39  * sendilkumarnjoined
10:59:54  * sendilkumarnquit (Remote host closed the connection)
11:00:03  * gibson042quit (Ping timeout: 245 seconds)
11:11:00  * aki_joined
11:11:17  * rmarkinsjoined
11:12:08  * akirosequit (Ping timeout: 245 seconds)
11:12:08  * aki_changed nick to akirose
11:17:12  * rmarkinsquit (Ping timeout: 272 seconds)
11:17:46  * gibson042joined
11:19:40  * keith_millerjoined
11:23:44  * sendilkumarnjoined
11:25:24  * keith_millerquit (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:10:52  * keith_millerjoined
12:36:35  * sendilkumarnquit (Remote host closed the connection)
12:36:44  * sendilkumarnjoined
12:58:56  <bradleymeck>annevk: it looks like explaining what an "own" property is, and what "has" means are being requested?
12:59:35  <bradleymeck>so what it means to have an own property and what it means to have properties otherwise
13:02:38  <annevk>bradleymeck: yeah, it's a lil vague how such statements work in terms of primitives defined in ES
13:08:28  <annevk>bradleymeck: it's also not always clear to what extent a host environment is allowed to use those primitives
13:11:12  <bradleymeck>i would be surprised if a host ever directly used the prose instead of some abstract op or using internal slot methods, as internal slot methods are generally what you want for object ops that are not being done using the Reference Type
13:11:31  * keith_millerquit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:11:39  <bradleymeck>we can try and figure out some note we can add though about when it is expected to use things maybe
13:14:05  * rmarkinsjoined
13:14:13  <annevk>Well, in the IDL case we basically want "If |O| has an own property with name |P|", which ES also uses itself and doesn't really offer an abstraction for
13:17:32  * aki_joined
13:17:32  * akirosequit (Ping timeout: 272 seconds)
13:17:46  * aki_changed nick to akirose
13:20:32  * rmarkinsquit (Ping timeout: 250 seconds)
13:49:43  <bradleymeck>annevk: does O.[[GetOwnProperty]] not satisfy that, or are you wanting one specifically with a "Has" true/false return
13:50:28  <bradleymeck>https://tc39.github.io/ecma262/#sec-hasownproperty exists, so i'm a little confused
13:51:43  <annevk>bradleymeck: did you read the IDL PR comments?
13:53:08  <bradleymeck>annevk: i did
13:53:48  <bradleymeck>i don't have a solution, but i'm just explaining what the spec has/generally should be used
13:53:56  <bradleymeck>idk the visibility algorithm in depth though
13:55:04  * jmdyckjoined
13:57:13  <annevk>So we could use OrdinaryGetOwnProperty (need to bypass proxies iirc), but then we duplicate a whole lot of language that isn't really needed
13:57:35  <annevk>So then the question is if we can use the language around Objects
13:57:56  <annevk>And then a side question is how much that language is formalized enough, as the section on Object itself only talks about get/set, not has
13:58:54  * rmarkinsjoined
14:00:02  <bradleymeck>i think we could expose something about prose in ECMA262 explaining "has" as it is not going to change, but I would probably want to figure out what is safe for a host to use with it since it gets around the meta object protocol intentionally
14:00:09  * rmarkinsquit (Read error: Connection reset by peer)
14:00:34  * rmarkinsjoined
14:01:06  <bradleymeck>i'm just not well informed enough on what this is trying to do
14:01:23  <bradleymeck>the visibility explainer kind of explains the intent, but not all the details
14:04:44  * rmarkinsquit (Ping timeout: 246 seconds)
14:04:54  <annevk>bradleymeck: afaik MOP are constraints on objects; when you define a host object, you need lower-level hooks, such as OrdinaryGetOwnProperty and in this case "has an own property"
14:06:33  <bradleymeck>mmmm but this is changing how one of the methods on an object works from outside, maybe i'm confused
14:06:57  * sendilkumarnquit (Remote host closed the connection)
14:09:41  * jorydotcomjoined
14:10:12  * jorydotcomquit (Remote host closed the connection)
14:13:35  <annevk>bradleymeck: it's basically defining a new proxy object
14:13:57  <annevk>sorry, exotic object
14:15:42  <bradleymeck>yea, but this seems new to me and i'm trying to process.
14:16:09  <bradleymeck>the exotic object is fine, the visibility algorithm is always within a MOP operation so it is probably fine to use
14:17:03  <bradleymeck>i think the prose we need to add is just about going through MOP operations *unless* you are creating an exotic object and are using things like "has" within a MOP operation implementation
14:17:18  <bradleymeck>that seems ok? will talk to ppl today at meeting in case they miss this
14:17:51  <annevk>Yeah, and does "has" need to be grounded better somehow?
14:17:55  <bradleymeck>using "has" outside of a MOP operation seems like something that would not be expected/should not be done
14:17:59  * sendilkumarnjoined
14:18:09  <annevk>Sure
14:18:15  <bradleymeck>annevk: the meaning of "has" won't change but we can add a couple sentences being clearer
14:18:37  <annevk>I don't think anyone is asking for it to change, I'm mostly asking for it to be defined
14:18:54  <bradleymeck>annevk: as an abstract op instead of a prose?
14:19:00  <annevk>No preference
14:19:19  <annevk>Although it does seem somewhat weird to me that not all of an object's layout is done using slots and abstract operations
14:19:32  <bradleymeck>ok, i'll figure this out
14:19:45  <annevk>ta
14:20:14  <bradleymeck>annevk: idk, slots being used would still devolve to a list of entries/map of properties
14:20:45  <bradleymeck>this just isolates the spec level stuff from host/user level
14:21:08  <bradleymeck>(though hosts can use slots)
14:23:59  <annevk>bradleymeck: fair, though it would be somewhat clearer that there's a container for this stuff
14:34:24  * sendilkumarnquit (Remote host closed the connection)
14:44:43  * sendilkumarnjoined
14:55:51  * keith_millerjoined
14:57:06  * keith_millerquit (Client Quit)
14:57:38  * keith_millerjoined
15:00:14  * keith_millerquit (Client Quit)
15:11:34  * sendilkumarnquit (Remote host closed the connection)
15:12:51  * sendilkumarnjoined
15:17:11  * sendilkumarnquit (Ping timeout: 246 seconds)
15:18:58  * michaelficarrajoined
15:19:03  * keith_millerjoined
15:20:04  * keith_millerquit (Client Quit)
15:21:09  * sendilkumarnjoined
15:21:59  * Nimelrianjoined
15:24:58  * aki_joined
15:25:03  * akirosequit (Ping timeout: 245 seconds)
15:25:12  * aki_changed nick to akirose
15:27:08  * gibson042quit (Ping timeout: 245 seconds)
15:37:23  * rmarkinsjoined
15:39:43  * rmarkinsquit (Remote host closed the connection)
15:40:21  * rmarkinsjoined
15:42:31  * gibson042joined
15:52:16  * michaelficarraquit (Quit: michaelficarra)
16:25:43  * sendilkumarnquit (Quit: Leaving...)
16:28:13  * michaelficarrajoined
16:36:38  * gibson042quit (Ping timeout: 246 seconds)
16:37:42  * cybaijoined
16:39:45  * cloudshujoined
17:04:11  * jridgewelljoined
17:14:17  * gibson042joined
17:23:16  * AtumTjoined
17:27:55  * keith_millerjoined
17:32:00  * aki_joined
17:33:24  * akirosequit (Ping timeout: 272 seconds)
17:33:25  * aki_changed nick to akirose
18:01:31  * keith_millerquit (Ping timeout: 268 seconds)
18:08:39  * jorydotcomjoined
18:41:11  * keith_millerjoined
19:04:08  * keith_millerquit (Remote host closed the connection)
19:04:26  * keith_millerjoined
19:14:42  * gibson0421joined
19:15:28  * gibson042quit (Ping timeout: 245 seconds)
19:22:07  * gibson0421quit (Ping timeout: 240 seconds)
19:37:32  * jwaldenjoined
19:38:43  * aki_joined
19:38:59  * akirosequit (Ping timeout: 244 seconds)
19:38:59  * aki_changed nick to akirose
19:39:01  * gibson042joined
19:40:52  * keith_millerquit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:50:47  * michaelficarraquit (Quit: michaelficarra)
20:14:10  * michaelficarrajoined
20:42:42  * cybaiquit (Remote host closed the connection)
20:50:34  * keith_millerjoined
20:55:22  <Domenic>michaelficarra: having not watched the presentation yet, what is the difference between your collect() modifications in https://github.com/tc39-transfer/proposal-iterator-helpers/issues/17 and reduce()?
21:01:42  <devsnek>also interested ^
21:12:50  <michaelficarra>Domenic: you can build the collect with reduce, but you can do a lot of things with reduce
21:13:07  <Domenic>It just sounds like the same thing, an initial value and an accumulator.
21:13:11  <michaelficarra>collect is reduce special-cased to accept just the combination and the empty value
21:13:24  <michaelficarra>reduce doesn't take an accumulator though
21:13:39  <Domenic>What is the difference between the reducer and an accumulator?
21:13:41  <michaelficarra>I can write collect in terms of reduce for you, hold on
21:13:58  <Domenic>The only signature I can imagine for accumulator is (soFar, thisValue) => combinedValue, which is the reducer (modulo thisArg)
21:14:47  <devsnek>`reduce((k, l) => [...l, k], [])`
21:15:01  <devsnek>is collect
21:16:25  <TabAtkins>Right, I think I'm with Domenic that the proposed mod to `collect()` are literally just `reduce()`.
21:17:46  <TabAtkins>(Having a simple way to reduce into an Array is a good thing; I'm in favor of trivial `.collect()`.)
21:18:08  <devsnek>agreed
21:19:19  * cybaijoined
21:20:21  <michaelficarra>okay, the difference is a bit subtle
21:21:18  <michaelficarra>reduce takes a "container" and an "entry" and combines them in some way, but the accumulator takes two "container"s and combines them
21:21:38  <michaelficarra>the difference is that reduce would require you to provide a "pure"/"of" function as well
21:21:48  <devsnek>consider me confused
21:22:05  <devsnek>i guess i'll need to watch the presentation
21:24:07  <michaelficarra>reduce :: (a -> b -> a) -> a -> f b; collect :: (f a -> f a -> f a) -> f a -> g a
21:24:10  <michaelficarra>if that helps at all
21:24:41  <devsnek>nope :D
21:26:39  <TabAtkins>What would the second container be here?
21:27:01  <TabAtkins>Given `Iterator([1,2,3]).collect((a,b)=>console.log(a,b)), what'll we log?
21:27:32  <michaelficarra>what is your "empty" value?
21:27:40  <TabAtkins>Assume it's `[]`
21:28:10  <michaelficarra>then `[], [1]`, `[1], [2]` and `[1,2], [3]`
21:28:28  <michaelficarra>assuming you also actually returned the concatenation
21:28:29  <TabAtkins>??? You're producing a *brand new* container to singly-wrap each of the items in the starting container?
21:28:48  <michaelficarra>yes, because that's sometimes the only way you can do things
21:29:17  <TabAtkins>Hmmmmm. Ok, I get that, sometimes the values in a monad can't be extracted directly.
21:29:34  <michaelficarra>that's right
21:29:44  <michaelficarra>unless they're also comonads :-)
21:29:52  <TabAtkins>It doesn't feel like this is a generalization of `collect()`, tho. It's a monadic reduce, rather than a foldable reduce.
21:30:43  <michaelficarra>I called it a generalisation because I could write "toArray" as `.collect(Array.prototype.concat, [])` or `.collect(Array)` depending on how we design the API
21:30:46  <TabAtkins>(what's the structure that lets you walk the monad like that, but only produce single-value monads? Clearly something foldable-related...)
21:31:30  <TabAtkins>I mean, yeah, but you can also write toArray with `reduce`, so the same argument applies.
21:31:52  <devsnek>whether you think of programming in terms of monads or not
21:31:55  <michaelficarra>sure, reduce is a generalisation of both of them
21:32:18  <michaelficarra>I didn't plan to use the M word in this conversation lol :-P
21:32:50  <TabAtkins>Haha, I used it because it's the right word for "I can write functions overthe values in this structure, but can't actually pull them out to look at"
21:32:52  * keith_millerquit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:33:44  <TabAtkins>I really, *really* wish we didn't call them "monads", ugh. Makes them sound so foreign and weird. They're Chainables; you can chain them, just like Functors (ugh) are Mappables.
21:34:45  <TabAtkins>So anyway, I've got an IO<Array<Number>>. I can't pull out the individual array values, but I can return an IO<Number> for each.
21:35:13  <TabAtkins>Well, hm. Can I. That's basically a Traverse, and IO isn't Traversable.
21:35:26  <TabAtkins>michaelficarra: got a concrete example? ^_^
21:35:44  <michaelficarra>oh boy, off the top of my head?
21:37:21  <TabAtkins>Hey, you proposed it, if you don't have a concrete use-case that's your own fault. ^_^
21:37:41  <Domenic>I think my takeaway here is that it would be nice if .collect() was an alias for .collect(Array) and you could also do .collect(Map), .collect(Set), etc. and that would call the Map/Set constructors or .of or .from methods
21:38:04  <michaelficarra>I like to accommodate others who have strangers needs than me
21:38:07  <michaelficarra>I'm just a bridge
21:38:08  <Domenic>Not sure about how that works with async
21:38:26  <TabAtkins>Domenic: It produces a promise for the constructed object.
21:38:39  <Bakkot>still think Promise.all makes more sense for the async collect case
21:38:41  <michaelficarra>Domenic: should work fine
21:38:57  <Domenic>So it collects into an... array? Then calls the Map() constructor?
21:39:05  <Domenic>Like, what is the intermediate holding area
21:39:12  <TabAtkins>More or less, yeah.
21:39:42  <devsnek>we do have a common "entries" interface between all these items
21:39:55  <TabAtkins>No generic "add one more item" protocol for the containers, so you have to do the whole thing at once and collect into an intermediate Array first.
21:40:23  <devsnek>in the spec there's a AddEntriesFromIterable method
21:40:30  <devsnek>which all the individual constructors use
21:40:44  <devsnek>there could be some symbol that constructors expose to consume entries interfaces
21:40:56  <TabAtkins>Like, would be more straightforward if they all had an `.addNext()` method that took an appropriately-shaped object (a value for Array and Set, a `[k,v]` pair for Map) matching each entry in their constructing iterators.
21:40:57  <devsnek>or maybe the instance
21:41:12  <devsnek>like Map.prototype[Symbol.addEntry] = Map.prototype.set
21:41:21  <Domenic>Scope creep....
21:41:25  <Domenic>Maybe toArray() is simplest for now
21:41:26  <TabAtkins>Then you can just build an empty on at the start, async-pull and add as you go, then finally resolve the promise with the completed object when you've drained the iterator.
21:41:36  <TabAtkins>Hah.
21:41:53  <Domenic>Or make collect() throw if called with more than 0 args so we can extend it in the future
21:41:57  <TabAtkins>michaelficarra: Anyway, get the people you're bridging for to provide a concrete use-case so we can evaluate it. ^_^
21:42:01  <Domenic>(Array always being the default.)
21:42:22  <devsnek>what would the internal makeup of collect be that using Array as a parameter works
21:42:39  <devsnek>like calling with the final array?
21:43:15  <devsnek>like if collect(Array) ~= Array(collect())
21:45:42  * aki_joined
21:46:01  <Domenic>Yeah except Array constructor is broken so probably .from()?
21:46:40  * akirosequit (Ping timeout: 250 seconds)
21:46:41  * aki_changed nick to akirose
21:47:08  * TabAtkinsis gonna go watch Lonsdorf's lecture real quick.
21:47:49  <devsnek>something interesting was Iterator.from
21:48:27  <devsnek>if i do `Iterator.from({ next() {} })`, the idea was to push out something that has those methods and the correct prototype?
21:48:39  <devsnek>like inheriting from both objects at once...
21:50:19  <Domenic>It inherits from the correct prototype, unclear exactly how
21:50:26  <Domenic>Probably it creates a wrapper that pulls
21:50:39  <Domenic>Like the wrapper's next() calls the provided object's next()
21:51:01  <devsnek>sounds useful
21:54:37  <michaelficarra>devsnek: I was thinking it would pull the methods from the appropriate places (ideally Symbol-valued properties that identify generally useful concepts)
21:54:41  <michaelficarra>(I'm talking about protocols)
21:56:12  <Bakkot>Domenic: anyway I do want to rename collect to `toArray` I think
21:56:34  <Bakkot>if that's what it does
21:56:56  <Bakkot>`Array.from(iterable)`, `iterable.toArray()` is a nice symmetry
21:57:04  <Bakkot>s/iterable/iterator/ I guess
22:05:12  <TabAtkins>michaelficarra: Ohhh, I see, you just want a monoidal reduce()
22:05:19  <TabAtkins>Not even a monadic one.
22:08:04  <TabAtkins>Hm, Lonsdorf is playing some trickery here tho. In the transducer section they talk about `concat` as a reducer; there the signature is `Fa -> a -> Fa`. Then in the monoid section they pretend its signature is `Fa -> Fa -> Fa`. None of the reducer stuff uses monoids directly.
22:10:42  <devsnek>i propose an implementation defined "use monadic" which overrides my proposal as needed
22:11:07  <TabAtkins>But the "monoidal fold" operation is more traditionally written with a monoid-lifter and then the foldable of values. (And if you have a real Monoid thing, you don't need to specify the joiner or the empty value.)
22:11:27  <TabAtkins>devsnek: (sorry, I'm responding backwards a bit.)
22:12:00  <devsnek>no you're fine i'm just failing at resting pragma jokes
22:14:13  <TabAtkins>So my point is, `Iterator([1,2,3]).collect(...)` wouldn't call the callback with an accumulator and `[1]`/etc, that's a different sort of method entirely.
22:14:17  <TabAtkins>Unless I'm totally misreading.
22:16:00  <devsnek>if it had a callback, i would hope it called it with the finished array
22:16:36  <devsnek>i'm still unconvinced collect needs a callback (and to that end, changing it to toArray seems reasonable)
22:19:20  <michaelficarra>yeah I guess it's Haskell's `mconcat`?
22:19:47  <michaelficarra>my intuition before was that it was a MonadPlus but if we remove Monad, we're just left with a Monoid
22:25:04  <TabAtkins>Yeah. So the signature you want is instead `iterator.collect(lifter)`, where `lifter` takes a value from the iterator and returns a Monoid wrapping that value. So `[1,2,3].collect(Sum)`, where `Sum` is a class implementing the three required monoid operations (`.of()`, `.empty()`, `.concat()`.
22:25:53  <TabAtkins>`class Sum { constructor(val) { this.val = val; } empty() { return Sum(0); } concat(that) { return Sum(this.val + that.val); }}`
22:27:07  <TabAtkins>And then if the values in the iterator are *already* monoids, you can call it with no args.
22:27:11  <michaelficarra>I figured we could do it without an "of"/"pure" though, as I mentioned above
22:27:14  <TabAtkins>But anyway, that's not .collect().
22:27:49  <TabAtkins>Not sure how you'd do it without the lifting operation.
22:28:06  <michaelficarra>yeah me either
22:28:17  <TabAtkins>Your suggested signature is basically providing the monoid operations directly, rather than just giving a class.
22:28:38  <michaelficarra>I suggested both
22:28:52  <michaelficarra>I don't care which one we pick
22:28:55  <TabAtkins>Ah, didn't see the monoid-only one.
22:32:37  <TabAtkins>Ah, and I guess we actually can't rely on the values already being monoids, since we don't know their type ahead of time, and thus can't select an empty value.
22:36:47  <michaelficarra>the user needs to provide an empty
22:37:48  <TabAtkins>Sure, if you're using a deconstructed monoid, where the function just takes all the bits itself rather than having them packaged into a pre-existing class.
22:38:02  <TabAtkins>But then you're just reinventing reduce() directly, except less convenient.
22:39:20  <TabAtkins>Because rather than the signature being `reduce((acc,b)=>acc, empty)`, you have `collect((monoid, monoid)=>monoid, empty, val=>monoid)`
22:40:08  <devsnek>this seems like a scary api
22:40:22  <TabAtkins>The main value in a monoidal reduce is that you can provide either (a) nothing, relying on the contents being monoidal, or (b) a lifter function only; because of type knowledge it automagically works correctly even when the iterator is empty.
22:40:36  <TabAtkins>Can't do that in JS; monoids don't have as much justification.
22:40:49  <devsnek>empty iterator is empty array
22:40:56  <devsnek>like how map on an empty array is still safe
22:41:07  <TabAtkins>devsnek: No, if your monoid is Sum, then empty iterator should be 0.
22:41:12  <TabAtkins>If Product, should be 1. Etc.
22:41:39  <devsnek>you mean
22:41:44  <devsnek>if the iterator has stuff
22:41:47  <devsnek>you want the starting value to be 1
22:41:52  <devsnek>otherwise you want the starting value to be 0
22:41:55  <TabAtkins>No.
22:41:59  <ljharb>it depends on the operation
22:42:12  <devsnek>then i don't understand what the existing reduce method is missing
22:42:17  <ljharb>`arr.reduce((a, b) => a + b, x)` should have `x` be `0`
22:42:23  <ljharb>but `arr.reduce((a, b) => a * b, x)` should have `x` be `1`
22:42:26  <ljharb>etc
22:42:36  <devsnek>yeah sure
22:42:53  <TabAtkins>I mean, if you call `[Sum(1), Sum(2), Sum(3)].collect()`, you should get back a `Sum(6)`. But if you call `[].collect()`, you should get back a `Sum(0)`, *assuming the language knows you intend that to be an Array of Sums*.
22:42:59  <TabAtkins>Since JS can't know that, you can't get that ability.
22:43:00  <devsnek>is this about wrapping the initial value into the thing that reduces
22:43:18  <devsnek>rather than them being separate args
22:43:19  <TabAtkins>So you still have to pass in an empty value, and you've lost most of the reason to use monoids in the first place, versus just using reducers.
22:54:04  <michaelficarra>I'd rather `[1, 2, 3][Symbol.iterator]().collect({ [Applicative.pure](a) { return { value: a }; }, [Semigroup.concat](a, b) { return { value: a.value + b.value }; }, [Monoid.empty]() { return { value: 0 }; } }).value` than do the reduction
23:00:23  <TabAtkins>I'm... not sure how serious you are. Versus `[1,2,3].reduce((a,b)=>a+b, 0)`
23:01:58  <michaelficarra>well it's not like I'm going to write those every time
23:02:54  <TabAtkins>If you're pre-writing the class, you can prewrite `function summer(a,b) { return a+b; }` and then just call `[1,2,3].reduce(summer, 0)`. ^_^
23:03:02  * rmarkins_joined
23:05:06  <TabAtkins>(Also, pedantry: the necessary method isn't Applicative.pure, but rather Pointed.of; monoids have no reliance on Applicative, but this usage of them does rely on the type being Pointed.)
23:05:27  * rmarkinsquit (Ping timeout: 240 seconds)
23:06:30  * keith_millerjoined
23:07:14  * jorydotcomquit (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:14:19  * keith_millerquit (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:14:49  * AtumTquit (Quit: AtumT)
23:19:02  <michaelficarra>the usefulness of Pointed on its own is contentious
23:20:27  <michaelficarra>I would not support introduction of a protocol that just supported `a -> f a` because you can't get anything for free from just that protocol
23:20:29  <TabAtkins>Sure, sure. Thus the pedantry.
23:20:59  <michaelficarra>also, on the name pedantry for transducers
23:21:00  <TabAtkins>(But it *is* weird to have a Monoid protocol that depends on part of the Applicative protocol for no clear reason.)
23:21:09  <michaelficarra>it really is a pattern, not a particular fucntion or data structure
23:21:44  <michaelficarra>I didn't re-watch Brian's talk, but I think he explains it in there actually
23:21:54  <michaelficarra>did he go into recursion schemes in his talk?
23:22:20  * Nimelrianquit (Ping timeout: 252 seconds)
23:23:02  <michaelficarra>transducers are just the usage of a specialised recursion scheme: specialised to iterable structures and specialised to an algebra that is built up from composed functions for the one (Cons) constructor
23:27:31  <TabAtkins>He only mentions transducers in the context I'm familiar with: functions that transform a reducer to other reducer.
23:27:44  <TabAtkins>Thus the name.
23:28:41  <TabAtkins>(I know "transduce" has the more general definition that's basically the same thing too, but it's usage wrt reducers in particular seems to mostly be a "transform"+"reduce" neologism pun.)
23:28:55  * jwaldenperks up at the magic word
23:30:50  * rmarkins_quit (Remote host closed the connection)
23:31:29  * rmarkinsjoined
23:31:39  <jwalden>that wasn't enough payoff in that mention of "pun" :-P
23:39:21  * michaelficarraquit (Quit: michaelficarra)
23:46:21  * gibson042quit (Quit: Leaving.)
23:50:43  * rmarkins_joined
23:51:23  * rmarkins_quit (Read error: Connection reset by peer)
23:51:47  * rmarkins_joined
23:52:42  * aki_joined
23:53:42  * rmarkinsquit (Ping timeout: 244 seconds)
23:53:48  * akirosequit (Ping timeout: 245 seconds)
23:53:48  * aki_changed nick to akirose
23:56:14  * rmarkins_quit (Ping timeout: 250 seconds)