Newest at the top
2025-05-18 12:44:18 +0200 | <lxsameer> | hmmmm but i think it's better to rethink the approach |
2025-05-18 12:41:22 +0200 | euleritian | (~euleritia@dynamic-176-006-136-230.176.6.pool.telefonica.de) |
2025-05-18 12:40:56 +0200 | euleritian | (~euleritia@ip4d17f864.dynamic.kabel-deutschland.de) (Ping timeout: 265 seconds) |
2025-05-18 12:40:45 +0200 | <Rembane> | So things became less and less safe and faster and faster over time? |
2025-05-18 12:40:12 +0200 | wootehfoot | (~wootehfoo@user/wootehfoot) (Ping timeout: 272 seconds) |
2025-05-18 12:38:55 +0200 | <tomsmeding> | given current state of things in GHC Haskell, I would never even consider using something else than an IORef, but because these things harken from >12 years ago, perhaps the runtime behaved differently |
2025-05-18 12:38:18 +0200 | <tomsmeding> | the comments below newUnique are interesting to read: apparently it was an MVar before, then it became STM, and then it became an IORef |
2025-05-18 12:37:04 +0200 | <tomsmeding> | except you probably need another unsafePerformIO around newUnique |
2025-05-18 12:36:51 +0200 | <tomsmeding> | well here is indeed precisely what I suggested, lol https://hackage.haskell.org/package/ghc-internal-9.1201.0/docs/src/GHC.Internal.Data.Unique.html#U… |
2025-05-18 12:36:28 +0200 | <tomsmeding> | yes, but you still need to write the unsafePerformIO yourself |
2025-05-18 12:36:13 +0200 | <lxsameer> | essentially it seems like the same thing that tomsmeding suggested |
2025-05-18 12:36:08 +0200 | sabathan2 | (~sabathan@amarseille-159-1-12-107.w86-203.abo.wanadoo.fr) |
2025-05-18 12:35:46 +0200 | sabathan2 | (~sabathan@amarseille-159-1-12-107.w86-203.abo.wanadoo.fr) (Remote host closed the connection) |
2025-05-18 12:35:39 +0200 | <lxsameer> | ah haskell has a Unique type too |
2025-05-18 12:35:23 +0200 | <tomsmeding> | the fact that you need ugliness like unsafePerformIO in my suggestion shows what you're asking for :p |
2025-05-18 12:35:01 +0200 | ChaiTRex | (~ChaiTRex@user/chaitrex) ChaiTRex |
2025-05-18 12:34:37 +0200 | ChaiTRex | (~ChaiTRex@user/chaitrex) (Remote host closed the connection) |
2025-05-18 12:22:21 +0200 | sabathan2 | (~sabathan@amarseille-159-1-12-107.w86-203.abo.wanadoo.fr) |
2025-05-18 12:21:59 +0200 | sabathan2 | (~sabathan@amarseille-159-1-12-107.w86-203.abo.wanadoo.fr) (Remote host closed the connection) |
2025-05-18 12:20:38 +0200 | notzmv | (~daniel@user/notzmv) (Ping timeout: 265 seconds) |
2025-05-18 12:16:56 +0200 | turlando | (~turlando@user/turlando) turlando |
2025-05-18 12:16:35 +0200 | sabathan2 | (~sabathan@amarseille-159-1-12-107.w86-203.abo.wanadoo.fr) |
2025-05-18 12:16:14 +0200 | sabathan2 | (~sabathan@amarseille-159-1-12-107.w86-203.abo.wanadoo.fr) (Remote host closed the connection) |
2025-05-18 12:15:40 +0200 | turlando | (~turlando@user/turlando) (Quit: No Ping reply in 180 seconds.) |
2025-05-18 12:13:43 +0200 | <mauke> | yeah, that's not a thing |
2025-05-18 12:13:27 +0200 | <mauke> | oh, you *want* it to be equal |
2025-05-18 12:10:04 +0200 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-05-18 12:10:01 +0200 | <lxsameer> | a = X; b = X; c = a; a /= b; a == c |
2025-05-18 12:09:22 +0200 | <mauke> | what does that mean |
2025-05-18 12:04:34 +0200 | <lxsameer> | sameness |
2025-05-18 12:04:11 +0200 | <mauke> | equal in what sense? |
2025-05-18 12:02:30 +0200 | <lxsameer> | mauke: a value is still equal to itself |
2025-05-18 11:55:56 +0200 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds) |
2025-05-18 11:54:02 +0200 | sabathan2 | (~sabathan@amarseille-159-1-12-107.w86-203.abo.wanadoo.fr) |
2025-05-18 11:53:38 +0200 | sabathan2 | (~sabathan@amarseille-159-1-12-107.w86-203.abo.wanadoo.fr) (Remote host closed the connection) |
2025-05-18 11:50:37 +0200 | <mauke> | instance Eq X where _ == _ = False |
2025-05-18 11:50:09 +0200 | Frostillicus | (~Frostilli@pool-71-174-119-69.bstnma.fios.verizon.net) (Ping timeout: 248 seconds) |
2025-05-18 11:49:24 +0200 | j1n37 | (~j1n37@user/j1n37) (Ping timeout: 244 seconds) |
2025-05-18 11:48:58 +0200 | econo_ | (uid147250@id-147250.tinside.irccloud.com) (Quit: Connection closed for inactivity) |
2025-05-18 11:48:42 +0200 | j1n37- | (~j1n37@user/j1n37) j1n37 |
2025-05-18 11:47:47 +0200 | <lxsameer> | tomsmeding: thank you |
2025-05-18 11:47:19 +0200 | Sgeo | (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
2025-05-18 11:47:14 +0200 | <tomsmeding> | obligatory warning: use atomicModifyIORef', and put NOINLINE on functions with unsafePerformIO |
2025-05-18 11:47:00 +0200 | <tomsmeding> | lxsameer: give it an Int field, don't export the constructor, and expose a smart constructor that increments a global IORef? |
2025-05-18 11:45:50 +0200 | <lxsameer> | and compare elements of this type based on their address |
2025-05-18 11:45:38 +0200 | <lxsameer> | for example, in an implementation of this type in an imperative lang, they just left it to the memory manager to choose a distinct address for each new value |
2025-05-18 11:44:11 +0200 | <lxsameer> | hey folks, how do you model a data type with one constructor, in such a way that every value of that type is a distinct value, so no two value are equal? the constructor does not take any input. it's literally `data X = X` |
2025-05-18 11:40:19 +0200 | lxsameer | (~lxsameer@Serene/lxsameer) lxsameer |
2025-05-18 11:39:49 +0200 | Frostillicus | (~Frostilli@pool-71-174-119-69.bstnma.fios.verizon.net) |
2025-05-18 11:36:40 +0200 | Frostillicus | (~Frostilli@pool-71-174-119-69.bstnma.fios.verizon.net) (Ping timeout: 260 seconds) |