Newest at the top
2024-05-17 20:40:53 +0200 | califax | (~califax@user/califx) |
2024-05-17 20:39:40 +0200 | califax | (~califax@user/califx) (Remote host closed the connection) |
2024-05-17 20:38:38 +0200 | <ph88> | glguy, thanks |
2024-05-17 20:34:52 +0200 | petrichor | (~znc-user@user/petrichor) |
2024-05-17 20:34:39 +0200 | <[Leary]> | ph88: I can't help much when I don't know just what it is you're struggling to achieve---the line where you've commented ?? was already, err, /mysterious/ to me from the start. That said, you probably want `type c <: cs = (forall x. cs x => c x) :: Constraint` (library-side) and `instance GetMessage <: cs => GetMessage (Entity cs)` (user-side). |
2024-05-17 20:34:31 +0200 | <glguy> | ph88: you need '[Op1] |
2024-05-17 20:33:35 +0200 | califax | (~califax@user/califx) |
2024-05-17 20:31:51 +0200 | petrichor | (~znc-user@user/petrichor) (Ping timeout: 268 seconds) |
2024-05-17 20:31:32 +0200 | <ph88> | glguy, this type checks https://play.haskell.org/saved/EAupqGhV but it carries Op2 into class of Op1 .. they need to be separate |
2024-05-17 20:31:29 +0200 | califax | (~califax@user/califx) (Remote host closed the connection) |
2024-05-17 20:30:06 +0200 | <ph88> | glguy, i adapted your code. It works with 2 constraints. Why does it fail with one? https://play.haskell.org/saved/EAupqGhV |
2024-05-17 20:16:44 +0200 | peterbecich | (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 268 seconds) |
2024-05-17 20:08:38 +0200 | <ph88> | [Leary], maybe i misunderstood. When i try to use your suggestion i'm not sure how it would work https://play.haskell.org/saved/KPj9Vxob |
2024-05-17 20:02:18 +0200 | peterbecich | (~Thunderbi@syn-047-229-123-186.res.spectrum.com) |
2024-05-17 19:58:13 +0200 | <glguy> | that repository predates quantified constraints |
2024-05-17 19:58:01 +0200 | <[Leary]> | Ah, though I guess that subset is actually just elem, due to QuantifiedConstraints limitations. |
2024-05-17 19:54:46 +0200 | <[Leary]> | glguy: Just BTW, the bare constraint is already powerful enough without the list. `class Null` ~ []; `class (c1 & c2) a` ~ c1 ++ c2; `type c <: cs = (forall x. cs x => c x) :: Constraint` ~ c subset cs. |
2024-05-17 19:50:55 +0200 | <[Leary]> | ph88: I think you've misunderstood. The `data` declaration in the library part doesn't need to change, the /user/ just uses the type at `Entity (c & GetMessage)` instead of `Entity c`. |
2024-05-17 19:45:05 +0200 | ubert | (~Thunderbi@p200300ecdf1a442dbe8e8c8f9360db77.dip0.t-ipconnect.de) (Ping timeout: 256 seconds) |
2024-05-17 19:44:20 +0200 | pavonia | (~user@user/siracusa) (Quit: Bye!) |
2024-05-17 19:43:06 +0200 | <glguy> | so on line 14 it's a constraint that Show is an element of the list (cs), 20 is that the list [Show] is a subset of the list cs . They're two ways to do write the same idea |
2024-05-17 19:42:39 +0200 | <ph88> | by the way, this reminds me of the effectful library, looks similar to how to compose effects |
2024-05-17 19:42:11 +0200 | <glguy> | ∈ is pronounced "element of" and ⊆ is pronounced "subset of or equal to" |
2024-05-17 19:41:13 +0200 | <ph88> | glguy, what are the symbols on line 14 and 20 in the gists ? |
2024-05-17 19:31:07 +0200 | nullie | (~nullie@nuremberg.nullie.name) |
2024-05-17 19:30:49 +0200 | nullie | (~nullie@nuremberg.nullie.name) (Quit: WeeChat 4.1.1) |
2024-05-17 19:27:31 +0200 | kimiamania | (~76637481@user/kimiamania) |
2024-05-17 19:25:53 +0200 | chele | (~chele@user/chele) (Remote host closed the connection) |
2024-05-17 19:25:11 +0200 | nullie | (~nullie@nuremberg.nullie.name) |
2024-05-17 19:24:48 +0200 | nullie | (~nullie@nuremberg.nullie.name) (Quit: WeeChat 4.1.1) |
2024-05-17 19:24:47 +0200 | <ph88> | glguy, cool i'll play around with that see how it goes |
2024-05-17 19:23:03 +0200 | <ph88> | [Leary], from my second paste https://play.haskell.org/saved/nsO7Fn41 when i move stuff from GetMessage (user part) into data Entity (library part) it defeats the goal. A creative idea nonetheless i will keep it in mind for other situations |
2024-05-17 19:23:00 +0200 | mei | (~mei@user/mei) |
2024-05-17 19:22:44 +0200 | peterbecich | (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 260 seconds) |
2024-05-17 19:21:27 +0200 | <glguy> | I did an example of this style a while back https://github.com/glguy/operations/blob/master/src/Example.hs |
2024-05-17 19:20:31 +0200 | <glguy> | Maybe you want to bake the idea of multiple constraints into your entity type? https://play.haskell.org/saved/cMgRB0yD |
2024-05-17 19:19:31 +0200 | <[Leary]> | ph88: Yes? I mean the type constructor defined by the `data Entity ...` declaration in your first paste. |
2024-05-17 19:16:34 +0200 | mei | (~mei@user/mei) (Remote host closed the connection) |
2024-05-17 19:15:55 +0200 | target_i | (~target_i@user/target-i/x-6023099) |
2024-05-17 19:10:53 +0200 | <ph88> | [Leary], will allow you to write `Entity (HasDataID & GetMessage)`. Do you mean data Entity ? |
2024-05-17 19:10:28 +0200 | nullie | (~nullie@nuremberg.nullie.name) |
2024-05-17 19:10:04 +0200 | nullie | (~nullie@2a01:4f8:c2c:6177::1) (Quit: WeeChat 4.1.1) |
2024-05-17 19:08:56 +0200 | peterbecich | (~Thunderbi@syn-047-229-123-186.res.spectrum.com) |
2024-05-17 19:05:32 +0200 | tzh | (~tzh@c-76-115-131-146.hsd1.or.comcast.net) |
2024-05-17 19:01:01 +0200 | <[Leary]> | No, that doesn't suffice for their use-case. |
2024-05-17 19:00:47 +0200 | <monochrom> | You should simply enable ConstraintKinds and write "type (&) c1 c2 a = (c1 a, c2 a)" |
2024-05-17 18:59:42 +0200 | <monochrom> | Again, "instance ... => Foo a" means that every type is a Foo instance. (Oh, the ... conditions are checked later and cause hard errors, not as preconditions.) |
2024-05-17 18:59:34 +0200 | <[Leary]> | "Use UndecidableSuperClasses to accept this" |
2024-05-17 18:57:32 +0200 | <ph88> | [Leary], something is not quite right https://play.haskell.org/saved/R4jW1YVV |
2024-05-17 18:56:05 +0200 | petrichor | (~znc-user@user/petrichor) |