2025/02/28

Newest at the top

2025-02-28 08:36:57 +0100 <kqr> I'm just aiming for conciseness and readability here. The original code said isJust a || isJust b || isJust c but the expressions a, b, and c are in reality longer and made the logic of the whole line difficult to overview
2025-02-28 08:36:34 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 272 seconds)
2025-02-28 08:35:49 +0100 <[exa]> On the very other side of the problem, you could do existential-style polymorphic lists to contain all possible justs in there. But don't if you don't have to.
2025-02-28 08:35:04 +0100 <[exa]> yes.
2025-02-28 08:34:59 +0100 <[exa]> for "or" you want to di as Keart says, with something like the <
2025-02-28 08:34:58 +0100 <kqr> But <|> maybe?
2025-02-28 08:34:49 +0100 <kqr> Oh, true.
2025-02-28 08:34:39 +0100 <[exa]> mine does "and"
2025-02-28 08:34:34 +0100 <lambdabot> Maybe a1 -> Maybe a2 -> Maybe a3 -> Bool
2025-02-28 08:34:33 +0100 <[exa]> you have "or" there
2025-02-28 08:34:33 +0100 <Leary> :t let { x ~|~ y = void x <|> void y; infixr 2 ~|~ } in \a b c -> isJust $ a ~|~ b ~|~ c
2025-02-28 08:34:30 +0100 <[exa]> ah wayit actually
2025-02-28 08:34:24 +0100 <kqr> Oh. Yeah, that definitely works. I just have to wrap my head around how the heck it works!
2025-02-28 08:33:48 +0100 <[exa]> (you can also do like isJust (a>>b>>c) or so, to have it inline. But you can't really put the abc into a single container.
2025-02-28 08:33:05 +0100j1n37(~j1n37@user/j1n37) (Read error: Connection reset by peer)
2025-02-28 08:33:05 +0100 <[exa]> https://play.haskell.org/saved/atW1eEnR <- kqr does this work for you?
2025-02-28 08:31:47 +0100 <[exa]> kqr: putting a,b,c into the same list is gonna be an issue. if you just want simpler code, you could abuse the monads a bit
2025-02-28 08:31:33 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn
2025-02-28 08:27:47 +0100 <kqr> Noob Haskell question: I have this expression: `or [isJust a, isJust b, isJust c]` and I'd like to translate it into `any isJust [a, b, c]` but this does not work because none of a, b, or c are of the same type. At first I thought I would be able to do something like `any isJust (map ($> ()) [a, b, c])` but of course this runs into the same problem! What are my alternatives here?
2025-02-28 08:27:38 +0100florida(~florida@2a02:ab88:7200:6a00:762b:62ff:fe83:1a1b) (Quit: Leaving)
2025-02-28 08:21:25 +0100bilegeek_(~bilegeek@2600:1008:b014:2c7:531b:7b59:1891:ee3a) (Ping timeout: 248 seconds)
2025-02-28 08:20:53 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
2025-02-28 08:19:29 +0100bilegeek(~bilegeek@2600:1008:b01f:5f7b:5bb4:d486:4e63:9b64) (Ping timeout: 260 seconds)
2025-02-28 08:18:49 +0100bilegeek__(~bilegeek@2600:1008:b061:9e8:b6a7:1e21:b590:dc2) bilegeek
2025-02-28 08:16:49 +0100bilegeek_(~bilegeek@2600:1008:b014:2c7:531b:7b59:1891:ee3a) bilegeek
2025-02-28 08:16:12 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn
2025-02-28 08:11:16 +0100Lord_of_Life_Lord_of_Life
2025-02-28 08:11:15 +0100euleritian(~euleritia@dynamic-176-006-140-035.176.6.pool.telefonica.de)
2025-02-28 08:10:45 +0100Lord_of_Life(~Lord@user/lord-of-life/x-2819915) (Ping timeout: 248 seconds)
2025-02-28 08:10:17 +0100euleritian(~euleritia@dynamic-176-006-140-040.176.6.pool.telefonica.de) (Ping timeout: 268 seconds)
2025-02-28 08:09:55 +0100Lord_of_Life_(~Lord@user/lord-of-life/x-2819915) Lord_of_Life
2025-02-28 08:08:07 +0100ft(~ft@p3e9bc68d.dip0.t-ipconnect.de) (Quit: leaving)
2025-02-28 08:05:23 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds)
2025-02-28 08:04:47 +0100bitdex(~bitdex@gateway/tor-sasl/bitdex) bitdex
2025-02-28 08:00:48 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn
2025-02-28 07:56:52 +0100acidjnk_new(~acidjnk@p200300d6e7283f90a88c11223635ddf2.dip0.t-ipconnect.de) acidjnk
2025-02-28 07:56:43 +0100alfiee(~alfiee@user/alfiee) (Ping timeout: 268 seconds)
2025-02-28 07:56:12 +0100peterbecich(~Thunderbi@syn-047-229-123-186.res.spectrum.com) peterbecich
2025-02-28 07:51:43 +0100alfiee(~alfiee@user/alfiee) alfiee
2025-02-28 07:50:18 +0100ensyde(~ensyde@2601:5c6:c200:6dc0::46e1) ensyde
2025-02-28 07:49:52 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
2025-02-28 07:44:45 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn
2025-02-28 07:41:47 +0100CryptLab(NSA@gateway/vpn/protonvpn/commanderbond007) (Ping timeout: 252 seconds)
2025-02-28 07:35:17 +0100j1n37(~j1n37@user/j1n37) j1n37
2025-02-28 07:33:55 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
2025-02-28 07:32:36 +0100bitdex(~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 264 seconds)
2025-02-28 07:30:08 +0100j1n37(~j1n37@user/j1n37) (Read error: Connection reset by peer)
2025-02-28 07:29:22 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn
2025-02-28 07:27:53 +0100j1n37(~j1n37@user/j1n37) j1n37
2025-02-28 07:23:35 +0100j1n37(~j1n37@user/j1n37) (Read error: Connection reset by peer)