Newest at the top
2025-03-03 23:20:23 +0100 | <monochrom> | No programming language can ban all abuses. |
2025-03-03 23:20:00 +0100 | simplystuart | (~simplystu@c-75-75-152-164.hsd1.pa.comcast.net) (Ping timeout: 244 seconds) |
2025-03-03 23:19:54 +0100 | <haskellbridge> | <Liamzee> i mean the only obviously bad thing that springs to mind is orphan instances |
2025-03-03 23:19:45 +0100 | <monochrom> | All abuses are smelly. Well, much worse than smelly, it's criminal. |
2025-03-03 23:19:08 +0100 | <haskellbridge> | <Liamzee> well, a different, more concrete question, what happened with the typeclass abuse thing, and why was it considered smelly? i.e, ad-hoc, lawless typeclasses intended to create OOP-style methods and functionality? |
2025-03-03 23:17:58 +0100 | <jle`> | i guess you could formalize it by seeing it in terms of `forall a. NumDict a -> a`, (forall a. NumDict a -> [a] -> r) -> r, and `forall a. NumDict a` |
2025-03-03 23:17:16 +0100 | <jle`> | so it's kind of neat when you CPS transform it you can see the Num/Fractional visually pop from negative to positive |
2025-03-03 23:16:14 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 272 seconds) |
2025-03-03 23:16:07 +0100 | <jle`> | yeah my two example types were the cps'd data N = forall a. Num a => N [a] and data F = forall a. Fractional a => F [a] |
2025-03-03 23:15:21 +0100 | <monochrom> | OTOH I'll admit it's flipped with "data N' = N' (forall a. Num a => a)" and the analogous F' |
2025-03-03 23:15:18 +0100 | <jle`> | yeah in the case i was talking about, F would be considered the subtype. only i use => F [a] instead of => F a |
2025-03-03 23:15:01 +0100 | <dolio> | Existentials like that sort of have the class in positive position. |
2025-03-03 23:14:45 +0100 | <dolio> | Yes. |
2025-03-03 23:14:39 +0100 | <monochrom> | If you give me an F value, I can repackage it as an N value. |
2025-03-03 23:14:19 +0100 | <monochrom> | Wait. So consider the existential types "data N = forall a. Num a => N a" and "data F = forall a. Fractional a => F a". Which one is a subtype of which? I think F is the subtype. |
2025-03-03 23:13:06 +0100 | myxos | (~myxos@syn-065-028-251-121.res.spectrum.com) myxokephale |
2025-03-03 23:12:31 +0100 | <jle`> | it's still a bit weird to think of `Num` alone as positive but i guess there is no need to formalize that |
2025-03-03 23:11:39 +0100 | <dolio> | Yeah. |
2025-03-03 23:11:22 +0100 | <jle`> | if Num is negative in forall a. Num a => [a] -> r then it'd be positive in (forall a. Num a => [a] -> r) -> r |
2025-03-03 23:11:18 +0100 | <monochrom> | s/You just/You know/ |
2025-03-03 23:11:13 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-03 23:10:41 +0100 | <monochrom> | It is pretty much why this world is such a mess. |
2025-03-03 23:10:31 +0100 | <monochrom> | You just, trying to increase divisiveness and "controversy". |
2025-03-03 23:10:06 +0100 | <monochrom> | Are you like a reporter for a politics newspaper? Because only they do this meme of "he said such and such, what do you think?" |
2025-03-03 23:09:24 +0100 | <monochrom> | Sure. So ask that particular Haskeller. |
2025-03-03 23:09:04 +0100 | <haskellbridge> | <Liamzee> because it was a stray comment by a Haskeller on /r/Haskell from up to 24 months ago |
2025-03-03 23:08:45 +0100 | <monochrom> | Why do people ask you what other people think? |
2025-03-03 23:08:34 +0100 | <dolio> | jle`: I think that's right, but there are to many negations for me to be really confident. |
2025-03-03 23:08:09 +0100 | <monochrom> | Why do you not ask those people? |
2025-03-03 23:08:06 +0100 | <haskellbridge> | <Liamzee> I'm working Rust right now, building a toy tetris game, and OOP's approach to data organization seems useful |
2025-03-03 23:08:05 +0100 | <jle`> | usually it's because their oop professor was mean to them |
2025-03-03 23:07:57 +0100 | <monochrom> | I don't know, because I am not one of them. |
2025-03-03 23:07:23 +0100 | <haskellbridge> | <Liamzee> why do people complain that OOP rots the mind? |
2025-03-03 23:06:44 +0100 | <jle`> | ...i think |
2025-03-03 23:06:24 +0100 | <jle`> | that translates well to how (forall a. Num a => [a] -> r) -> r is a supertype of (forall a. Fractional a => [a] -> r) -> r .... because the variances line up |
2025-03-03 23:05:01 +0100 | Googulator93 | (~Googulato@2a01-036d-0106-14b2-c443-5a96-b49d-1dd5.pool6.digikabel.hu) |
2025-03-03 23:04:45 +0100 | Googulator93 | (~Googulato@2a01-036d-0106-14b2-c443-5a96-b49d-1dd5.pool6.digikabel.hu) (Quit: Client closed) |
2025-03-03 23:03:48 +0100 | zungi | (~tory@user/andrewchawk) (Ping timeout: 264 seconds) |
2025-03-03 23:03:11 +0100 | <jle`> | oh nice that makes a lot of sense |
2025-03-03 23:01:35 +0100 | <dolio> | That's relatively normal for building things with arrows. The left-hand side is contravariant. |
2025-03-03 23:00:30 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 268 seconds) |
2025-03-03 22:57:13 +0100 | <jle`> | so Num is a superclass of Fractional but Num a => a is a subtype of Fractional a => a |
2025-03-03 22:54:48 +0100 | <jle`> | thanks |
2025-03-03 22:54:45 +0100 | <jle`> | ah. the report uses both superclass and subclass |
2025-03-03 22:53:22 +0100 | <geekosaur> | that's what the Report calls it |
2025-03-03 22:53:11 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-03 22:52:55 +0100 | <jle`> | but i do see people sometimes saying ie. Num is a superclass of Fractional |
2025-03-03 22:52:10 +0100 | <jle`> | maybe the only thing you can say is that Monoid is a constrained typeclass |
2025-03-03 22:50:32 +0100 | <jle`> | even though it sort of goes in the reverse direction of liskov substitution |
2025-03-03 22:49:23 +0100 | <jle`> | what's the actual term for the relationship between ie Semigroup and Monoid? is Monoid a subclass of Semigroup? |