Logs: liberachat/#haskell
| 2021-05-23 00:58:13 | <hpc> | maybe that's why i forgot :P |
| 2021-05-23 00:58:25 | <boxscape> | if it's this one it uses the FFI https://hackage.haskell.org/package/system-info-0.5.2/docs/src/System.OS.html |
| 2021-05-23 00:58:31 | <monochrom> | Totally exploits the fact that GHC does not do cross-OS-compilation. |
| 2021-05-23 00:59:00 | <monochrom> | How often do you get to say "linux GHC can't make a windows exe, and that's a good thing"? >:) |
| 2021-05-23 00:59:08 | <boxscape> | hehe |
| 2021-05-23 00:59:51 | × | dmwit quits (~dmwit@pool-173-66-86-32.washdc.fios.verizon.net) (Ping timeout: 265 seconds) |
| 2021-05-23 01:00:49 | → | dmwit joins (~dmwit@pool-173-66-86-32.washdc.fios.verizon.net) |
| 2021-05-23 01:00:50 | × | ddellacosta quits (~ddellacos@86.106.121.100) (Ping timeout: 264 seconds) |
| 2021-05-23 01:01:35 | <boxscape> | Perhaps there's some way to make this more rigorous and correct though, IORefs and Random both seem to have this property and both don't get information from outside the haskell program |
| 2021-05-23 01:02:11 | → | steve-chavez joins (~steve-cha@190.237.35.83) |
| 2021-05-23 01:02:26 | × | steve-chavez quits (~steve-cha@190.237.35.83) (Client Quit) |
| 2021-05-23 01:02:49 | → | steve-chavez joins (~steve-cha@190.237.35.83) |
| 2021-05-23 01:03:51 | <boxscape> | oh, I think it might be the same criterion that lets effects be run in ST instead of in IO |
| 2021-05-23 01:07:05 | <boxscape> | so |
| 2021-05-23 01:07:19 | <boxscape> | do actions of type `ST Something` always have to return the same `Something`? |
| 2021-05-23 01:07:50 | <boxscape> | ah wait |
| 2021-05-23 01:07:55 | <boxscape> | that's not quite how ST works |
| 2021-05-23 01:11:25 | → | hmmmas joins (~chenqisu1@183.217.200.8) |
| 2021-05-23 01:11:47 | × | xff0x quits (~xff0x@2001:1a81:52a0:e100:12d8:511d:ef81:b662) (Ping timeout: 272 seconds) |
| 2021-05-23 01:12:18 | <boxscape> | I suppose any `IO Something` you can get with `stToIO` must always produce the same value |
| 2021-05-23 01:12:55 | → | xff0x joins (~xff0x@2001:1a81:52b2:9700:762c:2533:bcf3:80b7) |
| 2021-05-23 01:14:02 | × | Morrow quits (~MorrowM_@147.161.15.179) (Ping timeout: 264 seconds) |
| 2021-05-23 01:14:12 | × | WikiLycurgus quits (~juan@cpe-45-46-140-49.buffalo.res.rr.com) (Quit: Exeunt) |
| 2021-05-23 01:16:24 | <yuglg> | That seems right |
| 2021-05-23 01:16:49 | → | Morrow joins (~Morrow@147.161.15.179) |
| 2021-05-23 01:17:25 | <boxscape> | okay |
| 2021-05-23 01:18:14 | → | Fare joins (~fare@2601:184:4a7f:995c:21a2:6e2:303e:7b32) |
| 2021-05-23 01:18:49 | <boxscape> | what makes a little uncomfortable is that `stToIO` takes a `ST RealWorld a` rather than a `forall s. ST s a`, and I read everywhere that this universal quantification over threads is what makes it pure |
| 2021-05-23 01:19:49 | × | shapr quits (~user@pool-100-36-247-68.washdc.fios.verizon.net) (Ping timeout: 272 seconds) |
| 2021-05-23 01:19:49 | × | Brumaire quits (~quassel@81-64-14-121.rev.numericable.fr) (Ping timeout: 272 seconds) |
| 2021-05-23 01:25:56 | → | cdsmith joins (~cdsmithus@c-73-184-127-183.hsd1.ga.comcast.net) |
| 2021-05-23 01:27:35 | × | Robin_Jadoul quits (~Robin_Jad@152.67.64.160) (Ping timeout: 252 seconds) |
| 2021-05-23 01:32:49 | × | lwerdna quits (~lerdna@97.104.76.14) (Quit: Lost terminal) |
| 2021-05-23 01:34:11 | × | waleee-cl quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 252 seconds) |
| 2021-05-23 01:34:57 | → | dy joins (~dy@cpe-75-80-50-89.san.res.rr.com) |
| 2021-05-23 01:35:29 | × | dy quits (~dy@cpe-75-80-50-89.san.res.rr.com) (Client Quit) |
| 2021-05-23 01:35:47 | → | dy joins (~dy@cpe-75-80-50-89.san.res.rr.com) |
| 2021-05-23 01:41:19 | → | hgolden joins (~hgolden2@cpe-172-114-84-61.socal.res.rr.com) |
| 2021-05-23 01:55:24 | × | agander_m quits (sid407952@tinside.irccloud.com) (Ping timeout: 272 seconds) |
| 2021-05-23 01:56:29 | → | agander_m joins (sid407952@id-407952.tinside.irccloud.com) |
| 2021-05-23 02:00:10 | × | nnm__ quits (~nnm@109.252.72.186) (Ping timeout: 264 seconds) |
| 2021-05-23 02:01:35 | ← | yin parts (~yang@user/yin) () |
| 2021-05-23 02:02:02 | <nshepperd> | that means it can access a previously created STRef Realworld |
| 2021-05-23 02:02:20 | × | xlei quits (znc@pool-68-129-84-118.nycmny.fios.verizon.net) (Read error: Connection reset by peer) |
| 2021-05-23 02:03:05 | × | raehik1 quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 272 seconds) |
| 2021-05-23 02:04:00 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-05-23 02:06:22 | → | barryfm joins (~Barry@184-089-175-050.res.spectrum.com) |
| 2021-05-23 02:07:12 | → | xlei joins (znc@pool-68-129-84-118.nycmny.fios.verizon.net) |
| 2021-05-23 02:08:04 | <boxscape> | Ah, I see. |
| 2021-05-23 02:08:21 | <nshepperd> | i think it's only 'forall s. ST s Something' that are guaranteed to always produce the same value |
| 2021-05-23 02:08:28 | <boxscape> | okay |
| 2021-05-23 02:08:39 | <nshepperd> | as long as you don't use unsafeIOToST |
| 2021-05-23 02:08:43 | <boxscape> | right |
| 2021-05-23 02:09:36 | → | Techcable joins (~Techcable@168.235.93.147) |
| 2021-05-23 02:12:54 | × | barryfm quits (~Barry@184-089-175-050.res.spectrum.com) (Quit: Leaving) |
| 2021-05-23 02:14:17 | × | Erutuon quits (~Erutuon@97-116-14-180.mpls.qwest.net) (Ping timeout: 244 seconds) |
| 2021-05-23 02:14:56 | → | barryfm joins (~Barry@184-089-175-050.res.spectrum.com) |
| 2021-05-23 02:16:32 | → | Erutuon joins (~Erutuon@97-116-14-180.mpls.qwest.net) |
| 2021-05-23 02:17:30 | × | irc_user quits (uid423822@id-423822.tooting.irccloud.com) (Quit: Connection closed for inactivity) |
| 2021-05-23 02:19:54 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 2021-05-23 02:19:54 | finn_elija | is now known as Guest2589 |
| 2021-05-23 02:19:54 | × | Guest2589 quits (~finn_elij@user/finn-elija/x-0085643) (Killed (tungsten.libera.chat (Nickname regained by services))) |
| 2021-05-23 02:19:54 | FinnElija | is now known as finn_elija |
| 2021-05-23 02:21:00 | × | Fare quits (~fare@2601:184:4a7f:995c:21a2:6e2:303e:7b32) (Ping timeout: 244 seconds) |
| 2021-05-23 02:21:36 | → | liv joins (~liv@bras-base-burlon0233w-grc-86-70-30-52-48.dsl.bell.ca) |
| 2021-05-23 02:22:09 | <liv> | Oh, V, are you the same V I'm thinking of? |
| 2021-05-23 02:23:46 | × | jao quits (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Remote host closed the connection) |
| 2021-05-23 02:25:38 | × | vk3wtf quits (~doc@61.68.250.44) (Quit: WeeChat 3.0.1) |
| 2021-05-23 02:25:56 | → | doc1 joins (~doc@61.68.250.44) |
| 2021-05-23 02:30:17 | → | jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) |
| 2021-05-23 02:31:26 | <dmwit> | Um. I jumped into the middle of this, so I may be missing some context. But a `forall s. ST s Something` isn't guaranteed to always produce the same value (or what would be the point of ST?), and `stToIO :: ST RealWorld Something -> IO Something` is not guaranteed to always produce the same Something. |
| 2021-05-23 02:32:45 | <nshepperd> | the point of st is to execute algorithms that are more efficient with mutability, isn't it? |
| 2021-05-23 02:32:46 | × | dtman34 quits (~dtman34@c-73-62-246-247.hsd1.mn.comcast.net) (Quit: ZNC 1.7.2+deb3 - https://znc.in) |
| 2021-05-23 02:33:41 | → | dtman34 joins (~dtman34@c-73-62-246-247.hsd1.mn.comcast.net) |
| 2021-05-23 02:34:39 | <boxscape> | okay, more precisely: Let's say you have an expression of type `x :: forall s . ST s Something`, and importantly x does not have any free variables. Would `main = stToIO x >>= print` always result in the same output? |
| 2021-05-23 02:35:15 | <boxscape> | (or rather, would it be guaranteed to always have the same output for a given x)) |
| 2021-05-23 02:35:50 | <dmwit> | nshepperd: Yes, exactly. And mutability means if you look at the same variable twice you might get different answers. |
| 2021-05-23 02:36:48 | <nshepperd> | dmwit: the forall is important |
| 2021-05-23 02:37:05 | <dmwit> | nshepperd: `readSTRef foo` has the forall |
| 2021-05-23 02:37:19 | <nshepperd> | no it doesn't |
| 2021-05-23 02:37:41 | <dmwit> | boxscape: Hm. You are talking about "same across program executions", not "same across multiple references to x"? Why? |
| 2021-05-23 02:37:55 | <boxscape> | `readSTRef :: STRef s a -> ST s a` is of type (forall s . STRef s a -> ST s a), not of type (forall s . ST s a) |
| 2021-05-23 02:38:07 | <boxscape> | dmwit because it was the simplest way I could think of to make my question precise |
| 2021-05-23 02:38:11 | <nshepperd> | the s is bound to the s of foo, not forall'd |
| 2021-05-23 02:38:16 | <nshepperd> | in that case |
| 2021-05-23 02:38:27 | <boxscape> | oh wait |
| 2021-05-23 02:38:31 | <boxscape> | I missed the foo |
| 2021-05-23 02:38:44 | <boxscape> | but yeah, no forall then I suppose |
| 2021-05-23 02:38:51 | → | mrkajetanp_ joins (~mrkajetan@88.98.245.28) |
| 2021-05-23 02:39:02 | dmwit | shrugs |
| 2021-05-23 02:39:06 | <dmwit> | newSTRef has the forall |
| 2021-05-23 02:39:14 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 264 seconds) |
| 2021-05-23 02:40:00 | × | doc1 quits (~doc@61.68.250.44) (Quit: WeeChat 3.1) |
| 2021-05-23 02:40:15 | → | doc1 joins (~doc@61.68.250.44) |
| 2021-05-23 02:40:16 | <boxscape> | % :t newSTRef |
| 2021-05-23 02:40:16 | <yahb> | boxscape: forall {a} {s}. a -> ST s (STRef s a) |
| 2021-05-23 02:40:23 | × | barryfm quits (~Barry@184-089-175-050.res.spectrum.com) (Quit: Leaving) |
| 2021-05-23 02:40:57 | <boxscape> | % :t newSTRef 'c' -- something like this would have the right type |
| 2021-05-23 02:40:57 | <yahb> | boxscape: forall {s}. ST s (STRef s Char) |
| 2021-05-23 02:41:00 | <dmwit> | If print showed you the, like, memory address that the reference was referencing, two runs of the program could reasonably allocate it in different places. |
All times are in UTC.