Newest at the top
2025-09-14 20:03:49 +0200 | zzz | yin |
2025-09-14 19:57:39 +0200 | AndreiDuma | (~AndreiDum@user/AndreiDuma) AndreiDuma |
2025-09-14 19:56:41 +0200 | AndreiDuma | (~AndreiDum@user/AndreiDuma) (Quit: My Mac has gone to sleep. ZZZzzz…) |
2025-09-14 19:52:55 +0200 | humasect | (~humasect@dyn-192-249-132-90.nexicom.net) humasect |
2025-09-14 19:49:35 +0200 | <tomsmeding> | the tricky thing being that many people don't know about this so they don't do it so you can't really rely on being able to `coerce` safely |
2025-09-14 19:48:38 +0200 | <tomsmeding> | c_wraith: which means that if coerce can break your internal invariants, one should assign stricter roles with explicit role signatures :) |
2025-09-14 19:48:19 +0200 | trickard_ | trickard |
2025-09-14 19:47:39 +0200 | zzz | (~zero@user/zero) zero |
2025-09-14 19:47:23 +0200 | zzz | (~zero@user/zero) (Remote host closed the connection) |
2025-09-14 19:32:55 +0200 | trickard_ | (~trickard@cpe-56-98-47-163.wireline.com.au) |
2025-09-14 19:30:30 +0200 | trickard_ | (~trickard@cpe-56-98-47-163.wireline.com.au) (Ping timeout: 256 seconds) |
2025-09-14 19:18:49 +0200 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-09-14 19:10:12 +0200 | AndreiDuma | (~AndreiDum@user/AndreiDuma) AndreiDuma |
2025-09-14 19:07:52 +0200 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 260 seconds) |
2025-09-14 18:57:56 +0200 | EvanR | (~EvanR@user/evanr) (Quit: Leaving) |
2025-09-14 18:35:49 +0200 | sprotte24 | (~sprotte24@p200300d16f0fa90034a8f8dc2eadcbb1.dip0.t-ipconnect.de) |
2025-09-14 18:30:06 +0200 | petrichor | (~jez@user/petrichor) (Ping timeout: 244 seconds) |
2025-09-14 18:27:50 +0200 | lxsameer | (~lxsameer@Serene/lxsameer) (Ping timeout: 245 seconds) |
2025-09-14 18:21:53 +0200 | trickard_ | (~trickard@cpe-56-98-47-163.wireline.com.au) |
2025-09-14 18:21:40 +0200 | trickard_ | (~trickard@cpe-56-98-47-163.wireline.com.au) (Read error: Connection reset by peer) |
2025-09-14 18:13:47 +0200 | segfaultfizzbuzz | (~segfaultf@12.172.219.17) (Ping timeout: 248 seconds) |
2025-09-14 18:09:55 +0200 | <mreh> | neat |
2025-09-14 18:09:31 +0200 | <monochrom> | OK, coerce is also conservative dynamically: in-memory representations are guaranteed to be identical. |
2025-09-14 18:08:39 +0200 | <monochrom> | The type system is also very conservative. :) |
2025-09-14 18:08:06 +0200 | <c_wraith> | ... at least from the type system POV. It may break internal invariants. |
2025-09-14 18:06:38 +0200 | <c_wraith> | the nice thing about Coercible is that it's conservative. If coerce works, it's safe. |
2025-09-14 18:06:16 +0200 | <mreh> | (type checks) |
2025-09-14 18:05:40 +0200 | <mreh> | well, it works |
2025-09-14 18:05:23 +0200 | <c_wraith> | it doesn't have real instances |
2025-09-14 18:05:16 +0200 | <c_wraith> | technically, Coercible is magic |
2025-09-14 18:03:47 +0200 | <geekosaur> | just the rules for implicit `Coercible` constraints. Phantom types are automatically compatible |
2025-09-14 18:02:57 +0200 | <mreh> | is that some GHC magic? |
2025-09-14 18:00:46 +0200 | <mreh> | really... |
2025-09-14 18:00:03 +0200 | <Leary> | If `type role B phantom`, you can also just use regular safe `coerce`. |
2025-09-14 17:59:15 +0200 | <mreh> | Leary, I could define sameB, but I want to derive the definition where possible |
2025-09-14 17:58:47 +0200 | <mreh> | Yeah, I've defined B, and it is a true phantom type |
2025-09-14 17:58:18 +0200 | <Leary> | mreh: If you control `B`, expose `sameB :: B a -> B b -> Bool` and use that. Otherwise, `unsafeCoerce` may be the only choice. |
2025-09-14 17:57:58 +0200 | <geekosaur> | if it is phantom, then unsafeCoerce is fine |
2025-09-14 17:57:41 +0200 | <geekosaur> | doesn't look like one to me? although I'd have to see the definition of B to know for certain |
2025-09-14 17:55:41 +0200 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-09-14 17:55:28 +0200 | <mreh> | that type parameter `a` in `B a` is just a phantom type |
2025-09-14 17:53:34 +0200 | <mreh> | ^ can I do this legitimately with unsafeCoerce? |
2025-09-14 17:53:19 +0200 | <mreh> | instance Eq B' where (B' a) == (B' b) = ??? |
2025-09-14 17:53:11 +0200 | <mreh> | data B' = forall a. B' (B a) |
2025-09-14 17:51:08 +0200 | mreh | (~matthew@host86-146-25-35.range86-146.btcentralplus.com) mreh |
2025-09-14 17:49:30 +0200 | lxsameer | (~lxsameer@Serene/lxsameer) lxsameer |
2025-09-14 17:44:49 +0200 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds) |
2025-09-14 17:39:54 +0200 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-09-14 17:39:18 +0200 | segfaultfizzbuzz | (~segfaultf@12.172.219.17) |
2025-09-14 17:35:54 +0200 | lisbeths | (uid135845@id-135845.lymington.irccloud.com) (Client Quit) |