Logs: liberachat/#haskell
| 2021-07-01 21:19:19 | <tomsmeding> | but doesn't mutate the reference |
| 2021-07-01 21:19:26 | × | Iryon quits (~Iryon@2a02:a31a:a045:3500:90e2:686f:e863:4359) (Remote host closed the connection) |
| 2021-07-01 21:19:29 | <davean> | Right because we're a functional language |
| 2021-07-01 21:19:31 | <tomsmeding> | safinaskar: I think the conclusion is that at least vector doesn't provide the exact API you want |
| 2021-07-01 21:19:46 | <safinaskar> | tomsmeding: yes |
| 2021-07-01 21:19:53 | <safinaskar> | okey, i will try to find library i want |
| 2021-07-01 21:20:14 | <davean> | I mean in a technical sense nothing will |
| 2021-07-01 21:20:18 | <davean> | Haskell always rebinds |
| 2021-07-01 21:20:24 | <tomsmeding> | it could, right? |
| 2021-07-01 21:20:30 | <tomsmeding> | safinaskar was asking for a mutable-vector API |
| 2021-07-01 21:20:34 | <tomsmeding> | in an ST monad |
| 2021-07-01 21:20:40 | <tomsmeding> | and then you suddenly have all kinds of possibilities |
| 2021-07-01 21:20:45 | <davean> | It could look like it, but it couldn't do it |
| 2021-07-01 21:20:54 | <davean> | Not at a low level you don't |
| 2021-07-01 21:21:00 | <davean> | the ST cell will constantly rebind |
| 2021-07-01 21:21:02 | <davean> | at best |
| 2021-07-01 21:21:17 | <tomsmeding> | will the underlying mutable byte array not be modified in-place? |
| 2021-07-01 21:21:23 | <koz> | I'm doing something like [d| instance $(foo) => IsBar ... |]. According to GHC, foo :: Q Type. However, I can't see a way to construct a list of superclass constraints in Type's data constructors. What am I missing? |
| 2021-07-01 21:21:28 | × | acid quits (~acid@user/acid) (Read error: Connection reset by peer) |
| 2021-07-01 21:21:36 | → | acid joins (~acid@user/acid) |
| 2021-07-01 21:22:05 | <davean> | tomsmeding: it'll be modified in place, sure, but your pointer to it won't - and thats the same low level operations I was describing above, and looks almost the same at the higher level |
| 2021-07-01 21:22:33 | <tomsmeding> | davean: the point is that you can make an implementation of the suggested API that has the intended complexity |
| 2021-07-01 21:22:33 | <davean> | tomsmeding: Haskell implimentations reuse parts in memory all the time |
| 2021-07-01 21:22:39 | <tomsmeding> | whether some pointers are copied or not is immaterial :p |
| 2021-07-01 21:22:47 | <davean> | tomsmeding: and what we already have has the same complexity and the same oeprations |
| 2021-07-01 21:22:57 | <tomsmeding> | no, the operations have a slightly different API |
| 2021-07-01 21:23:15 | <davean> | Right, at the end you unstream |
| 2021-07-01 21:23:19 | <tomsmeding> | of course, perhaps it might be good to restructure code to use the existing API instead of forcing your own |
| 2021-07-01 21:23:20 | <davean> | vs. freeze |
| 2021-07-01 21:23:22 | <tomsmeding> | but that's a different question! |
| 2021-07-01 21:23:27 | <davean> | No, no restructuring |
| 2021-07-01 21:23:37 | <davean> | its the difference between unstream and freeze |
| 2021-07-01 21:24:18 | <tomsmeding> | I kind of feel we're talking past each other here :) |
| 2021-07-01 21:24:22 | <davean> | maybe |
| 2021-07-01 21:24:30 | <davean> | have you looked at the streaming stuff? |
| 2021-07-01 21:25:14 | <tomsmeding> | I'm not familiar with the fusion internals, so I was trying to think about implementing the given API based on top-level, non-streaming vector functions |
| 2021-07-01 21:25:21 | <davean> | This is NOT internals really |
| 2021-07-01 21:25:31 | <davean> | This is an exposed interface |
| 2021-07-01 21:25:39 | <davean> | This is the top level API |
| 2021-07-01 21:25:43 | × | dhouthoo quits (~dhouthoo@178-117-36-167.access.telenet.be) (Quit: WeeChat 3.1) |
| 2021-07-01 21:25:54 | <tomsmeding> | which I clearly know too little about :) |
| 2021-07-01 21:26:15 | → | falafel joins (~falafel@pool-96-255-70-50.washdc.fios.verizon.net) |
| 2021-07-01 21:26:38 | <tomsmeding> | I'll have a better look at it at some point, because it looks kind of sophisticated |
| 2021-07-01 21:26:51 | <tomsmeding> | the design, at least |
| 2021-07-01 21:27:29 | <davean> | tomsmeding: what about it? |
| 2021-07-01 21:27:37 | <davean> | its almost directly parrallel the standard vector API |
| 2021-07-01 21:28:16 | <tomsmeding> | maybe I should stop making unsubstantiated claims |
| 2021-07-01 21:28:22 | <monochrom> | koz: ForallT has a Cxt field. Cxt = [Pred] = [Type]. That would be a list of constraints. |
| 2021-07-01 21:28:29 | → | cheater1__ joins (~Username@user/cheater) |
| 2021-07-01 21:28:30 | <davean> | tomsmeding: note I said Vector, not MVector |
| 2021-07-01 21:28:35 | <koz> | monochrom: Ah, thanks! |
| 2021-07-01 21:28:36 | × | cheater quits (~Username@user/cheater) (Ping timeout: 272 seconds) |
| 2021-07-01 21:28:42 | cheater1__ | is now known as cheater |
| 2021-07-01 21:28:44 | <davean> | tomsmeding: the difference is in name binding |
| 2021-07-01 21:28:59 | <koz> | What would go in its third argument in this case? |
| 2021-07-01 21:29:04 | <safinaskar> | davean: "see snoc and cons" - they are pure functional. They return other vector, not the same. (I want api to look like it modifies in place) |
| 2021-07-01 21:29:11 | <koz> | Or should I wrap the whole thing? |
| 2021-07-01 21:29:22 | <davean> | safinaskar: that does modify in place. |
| 2021-07-01 21:29:23 | <koz> | So it'd be [d| instance $(foo) where ... |]? |
| 2021-07-01 21:29:47 | <geekosaur> | you need to be in IO or ST to do that. but are you prematurely optimizing, or just using a non-Haskelly API for some reason? |
| 2021-07-01 21:29:53 | <tomsmeding> | davean: note the "api to look like" |
| 2021-07-01 21:29:55 | <davean> | safinaskar: or at least it doesn't move, copy, or such any existing data |
| 2021-07-01 21:30:07 | <monochrom> | Hrm, I don't know. I would expect foo :: Q [Type] actually. |
| 2021-07-01 21:30:14 | <davean> | "In place" is a little undefined for new data! :) |
| 2021-07-01 21:30:23 | <davean> | In terms of hte old data though, it doesn't touch it |
| 2021-07-01 21:30:43 | <koz> | monochrom: That's what I would expect as well, but clearly not. I can wrap the whole thing if that's what it takes. |
| 2021-07-01 21:30:51 | <monochrom> | so that it means Q [Pred], list of constraints |
| 2021-07-01 21:31:02 | <davean> | tomsmeding: which part do you mean by look-like here? |
| 2021-07-01 21:31:55 | <koz> | If I try [d| instance $(foo) where ... |], GHC complains. |
| 2021-07-01 21:32:02 | <davean> | tomsmeding: do you want hte name rebindign to be implicite never explicite? I guess I don't see a difference because the name always rebinds |
| 2021-07-01 21:32:05 | <koz> | (aka it tells me my instance is malformed) |
| 2021-07-01 21:32:31 | × | gehmehgeh quits (~user@user/gehmehgeh) (Quit: Leaving) |
| 2021-07-01 21:32:35 | <koz> | But if I try [d| instance $(foo) => IsBar (conT typeName) where ... |], GHC insists that foo :: Q Type. |
| 2021-07-01 21:34:17 | <tomsmeding> | davean: ah now I see, it was me who was confused. safinaskar asked for a function with type signature (Vec s a -> a -> ST s (Vec s a)), whereas I thought they were asking for (Vec s a -> a -> ST s ()) |
| 2021-07-01 21:34:32 | <davean> | tomsmeding: Ah! ok, so yah |
| 2021-07-01 21:34:37 | <tomsmeding> | where I would say that the second "looks like" it modifies in place, whereas the first doesn't |
| 2021-07-01 21:34:54 | <tomsmeding> | what they do to the underlying buffer is a different, orthogonal issue (which the question also had a requirement on) |
| 2021-07-01 21:35:40 | <davean> | tomsmeding: well this explains our conversation :) |
| 2021-07-01 21:35:43 | × | fendor quits (~fendor@77.119.218.107.wireless.dyn.drei.com) (Read error: Connection reset by peer) |
| 2021-07-01 21:35:45 | <tomsmeding> | :') |
| 2021-07-01 21:36:42 | → | fendor joins (~fendor@77.119.218.107.wireless.dyn.drei.com) |
| 2021-07-01 21:36:44 | tomsmeding | was confused by the language of "look like" which I would interpret as the second type signature |
| 2021-07-01 21:36:50 | <safinaskar> | tomsmeding: yes, i mean type with "ST s ()" in the end |
| 2021-07-01 21:36:54 | <tomsmeding> | lol |
| 2021-07-01 21:37:00 | <safinaskar> | it seems i can write lib i want |
| 2021-07-01 21:37:07 | <safinaskar> | wait 5 mins, i will show you code |
| 2021-07-01 21:37:25 | <monochrom> | All pronouns and the adjective "like" should be banned from programming discussions. |
| 2021-07-01 21:37:47 | → | acidjnk_new joins (~acidjnk@p200300d0c72b9504558b1d2f6b7134fe.dip0.t-ipconnect.de) |
| 2021-07-01 21:38:04 | tomsmeding | . o O ( SELECT * FROM table WHERE thing LIKE '%abc%' ) |
| 2021-07-01 21:38:24 | <safinaskar> | tomsmeding: use "he" when talking about me |
| 2021-07-01 21:38:26 | <monochrom> | Programming is not marketing, there is no room for that much ambiguity and refusing to really spell out what you mean. |
| 2021-07-01 21:39:30 | <tomsmeding> | safinaskar: I suspected that, but I try to build a habit of saying 'they' in any situation of vaguely unclear genering :p |
| 2021-07-01 21:39:56 | × | tabemann quits (~tabemann@172-13-49-137.lightspeed.milwwi.sbcglobal.net) (Remote host closed the connection) |
| 2021-07-01 21:40:05 | <tomsmeding> | monochrom: I would love to live in that world |
| 2021-07-01 21:40:24 | <tomsmeding> | also where everyone speaks and writes the common language with poise |
| 2021-07-01 21:40:30 | <tomsmeding> | unfortunately that is not the world we live in :p |
| 2021-07-01 21:41:51 | × | hsiktas[m] quits (~hsiktasma@2001:470:69fc:105::30d4) (Quit: node-irc says goodbye) |
| 2021-07-01 21:43:29 | × | falafel quits (~falafel@pool-96-255-70-50.washdc.fios.verizon.net) (Ping timeout: 258 seconds) |
| 2021-07-01 21:43:30 | → | tabemann joins (~tabemann@172-13-49-137.lightspeed.milwwi.sbcglobal.net) |
| 2021-07-01 21:43:35 | <tomsmeding> | s/genering/gendering/ .-. |
All times are in UTC.