2025/09/29

Newest at the top

2025-09-29 13:42:09 +0200 <yin> programming languages at least
2025-09-29 13:41:47 +0200 <yin> ... "logical languages"?
2025-09-29 13:39:45 +0200 <yin> sshine: i am vehemently agains the idea that logic languages should emulate natural language
2025-09-29 13:38:50 +0200 <yin> so we need the $
2025-09-29 13:38:15 +0200 <yin> in my mind, we would ideally bind the infix operator more tightly than function application, but that's not possible
2025-09-29 13:37:39 +0200 <lambdabot> Just 3
2025-09-29 13:37:37 +0200 <yin> > (+) `liftA2` (Just 1) $ (Just 2)
2025-09-29 13:35:17 +0200Lord_of_Life(~Lord@user/lord-of-life/x-2819915) Lord_of_Life
2025-09-29 13:33:37 +0200Lord_of_Life(~Lord@user/lord-of-life/x-2819915) (Ping timeout: 264 seconds)
2025-09-29 13:28:52 +0200xff0x(~xff0x@2405:6580:b080:900:fe2c:68a3:b199:389f)
2025-09-29 13:28:39 +0200arandombit(~arandombi@user/arandombit) (Ping timeout: 250 seconds)
2025-09-29 13:26:34 +0200Unicorn_Princess(~Unicorn_P@user/Unicorn-Princess/x-3540542) Unicorn_Princess
2025-09-29 13:22:41 +0200arandombit(~arandombi@user/arandombit) arandombit
2025-09-29 13:22:24 +0200Unicorn_Princess(~Unicorn_P@user/Unicorn-Princess/x-3540542) (Remote host closed the connection)
2025-09-29 13:19:10 +0200 <sshine> yin, at least `on` reads nicely.
2025-09-29 13:18:06 +0200arandombit(~arandombi@user/arandombit) (Ping timeout: 256 seconds)
2025-09-29 13:13:15 +0200arandombit(~arandombi@user/arandombit) arandombit
2025-09-29 13:09:40 +0200 <yin> maybe you're right after all
2025-09-29 13:09:31 +0200arandombit(~arandombi@user/arandombit) (Ping timeout: 255 seconds)
2025-09-29 13:08:21 +0200chromoblob(~chromoblo@user/chromob1ot1c) chromoblob\0
2025-09-29 13:08:00 +0200 <merijn> Leary: I mean, that $ and & hack is approximately infinitely less readable than the prefix `liftA2` call, so I would argue no, it's also 2 operators + 1 a function, not a single infix thing :p
2025-09-29 13:08:00 +0200chromoblob(~chromoblo@user/chromob1ot1c) (Read error: Connection reset by peer)
2025-09-29 13:06:24 +0200 <Leary> It worked, didn't it?
2025-09-29 13:06:11 +0200 <merijn> And if you're gonna bind a name, then you can easily to whatever infix you want
2025-09-29 13:05:55 +0200 <lambdabot> Just 5
2025-09-29 13:05:54 +0200 <merijn> > let (☃) = liftA2 (+) in Just 2 ☃ Just 3
2025-09-29 13:05:29 +0200justache(~justache@user/justache) (bye?)
2025-09-29 13:05:21 +0200 <merijn> You have to bind the partial application to a name, then
2025-09-29 13:05:01 +0200 <merijn> Leary: Right, but that can't be valid Haskell to begin with
2025-09-29 13:04:48 +0200arandombit(~arandombi@user/arandombit) arandombit
2025-09-29 13:04:47 +0200 <lambdabot> Just 3
2025-09-29 13:04:45 +0200 <Leary> > Just 1 &liftA2 (+)$ Just 2
2025-09-29 13:04:41 +0200 <lambdabot> Just 3
2025-09-29 13:04:40 +0200 <merijn> > let (☃) = liftA2 in ((+) ☃ (Just 1)) (Just 2)
2025-09-29 13:04:24 +0200 <lambdabot> with actual type ‘Maybe a0’
2025-09-29 13:04:24 +0200 <lambdabot> • Couldn't match expected type ‘Maybe a1 -> f c’
2025-09-29 13:04:24 +0200 <lambdabot> error:
2025-09-29 13:04:22 +0200 <merijn> > let (☃) = liftA2 in (+) ☃ (Just 1) (Just 2)
2025-09-29 13:03:24 +0200 <merijn> That seems very awkward to use
2025-09-29 13:03:15 +0200 <lambdabot> Just 3
2025-09-29 13:03:14 +0200 <merijn> > ((+) `liftA2` (Just 1)) (Just 2)
2025-09-29 13:03:13 +0200 <yin> now we could write <$> ... <*>, you're right! but sometimes, liftA2 is more performant
2025-09-29 13:03:06 +0200 <Leary> Binary? `liftA2` tends to be given either one or three arguments.
2025-09-29 13:02:39 +0200 <merijn> I don't see how liftA2 nicely turns into an infix binary operator, tbh
2025-09-29 13:02:00 +0200 <yin> useful and ubiquitous binary operation that I feel is awkward to write as prefix, not unlike `on`
2025-09-29 13:00:51 +0200CiaoSen(~Jura@2a02:8071:64e1:da0:5a47:caff:fe78:33db) (Ping timeout: 244 seconds)
2025-09-29 12:57:25 +0200 <merijn> And that notation trivialiases to any arity
2025-09-29 12:56:42 +0200 <lambdabot> Applicative f => (a1 -> a2 -> b) -> f a1 -> f a2 -> f b
2025-09-29 12:56:41 +0200 <merijn> :t let lift f x y = f <$> x <*> y in lift
2025-09-29 12:56:12 +0200 <merijn> yin: I mean, that's just a combination of <$> and <*>?