Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→ 1,802,737 events total
2025-11-07 09:50:25 <kuribas> Is there a shorter way to say asum (map (\x -> ...maybe...) elems)
2025-11-07 09:50:34 <lortabac> the most annoying one for me is "Use newtype instead of data"
2025-11-07 09:50:47 <__monty__> Yeah, seems like personal preference to me.
2025-11-07 09:50:49 <lortabac> there is no way I can accidentally mix up newtype and data
2025-11-07 09:50:59 <lortabac> I don't see why this warning exists
2025-11-07 09:52:00 <__monty__> It's an optimization, I don't think single-constructor data has any advantages over newtype?
2025-11-07 09:52:17 <kuribas> lortabac: right, that one
2025-11-07 09:52:29 <kuribas> __monty__: yes, lazyness.
2025-11-07 09:53:19 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds)
2025-11-07 09:53:32 <Leary> kuribas: `find`
2025-11-07 09:54:20 <__monty__> Maybe it's a matter of reducing your use of the linting tool rather?
2025-11-07 09:55:15 <Leary> Also, linter defaults are just defaults. You're supposed to configure away the hints you don't care for.
2025-11-07 09:55:29 × xff0x quits (~xff0x@fsb6a9491c.tkyc517.ap.nuro.jp) (Ping timeout: 260 seconds)
2025-11-07 09:56:50 <kuribas> :t find
2025-11-07 09:56:51 <lambdabot> Foldable t => (a -> Bool) -> t a -> Maybe a
2025-11-07 09:57:02 <__monty__> It's slightly annoying when you have to litter the codebase with comments to disable lints.
2025-11-07 09:57:16 <kuribas> Leary: find isJust ?
2025-11-07 09:57:49 <kuribas> Leary: but I'll still need to map.
2025-11-07 09:57:54 <lortabac> kuribas: listToMaybe (mapMaybe (\x -> ...) elems)
2025-11-07 09:57:58 CiaoSen joins (~Jura@2a02:8071:64e1:da0:5a47:caff:fe78:33db)
2025-11-07 09:58:17 <lortabac> not shorter but a little less exotic than 'asum'
2025-11-07 10:01:17 Zemy_ joins (~Zemy@2600:100c:b0a1:9f27:6026:a3ff:fe87:99d9)
2025-11-07 10:01:17 × Zemy quits (~Zemy@72.178.108.235) (Read error: Connection reset by peer)
2025-11-07 10:01:21 <Leary> :t \f -> getFirst . foldMap (First . f)
2025-11-07 10:01:22 <lambdabot> Foldable t => (a1 -> Maybe a2) -> t a1 -> Maybe a2
2025-11-07 10:02:37 chele joins (~chele@user/chele)
2025-11-07 10:02:40 Zemy joins (~Zemy@72.178.108.235)
2025-11-07 10:02:48 <Leary> :t \f -> getAlt . foldMap (Alt . f)
2025-11-07 10:02:50 <lambdabot> forall k (t :: * -> *) (f :: k -> *) (a1 :: k) a2. (Foldable t, Monoid (Alt f a1)) => (a2 -> f a1) -> t a2 -> f a1
2025-11-07 10:03:34 <lortabac> I have the impression that I spend most of my life opting out of things. I wished stupid warnings wasn't part of that
2025-11-07 10:04:02 <kuribas> Sometimes I wonder if all these abstractions really make programs easier and more robust.
2025-11-07 10:04:06 <kuribas> It's mostly fun.
2025-11-07 10:04:29 <lortabac> maybe 90% fun and 10% effectiveness?
2025-11-07 10:04:41 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
2025-11-07 10:05:37 × Zemy_ quits (~Zemy@2600:100c:b0a1:9f27:6026:a3ff:fe87:99d9) (Ping timeout: 260 seconds)
2025-11-07 10:05:43 <kuribas> THe biggest advantage IMO is ADTs, pattern matching, and purity...
2025-11-07 10:09:30 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds)
2025-11-07 10:10:18 <__monty__> :t \f -> foldr ((<|>) . f) empty -- Technically shorter, I suppose.
2025-11-07 10:10:19 <lambdabot> (Foldable t, Alternative f) => (a1 -> f a2) -> t a1 -> f a2
2025-11-07 10:10:41 chexum joins (~quassel@gateway/tor-sasl/chexum)
2025-11-07 10:11:05 fp joins (~Thunderbi@130.233.70.136)
2025-11-07 10:12:54 <__monty__> Relude has `asumMap`.
2025-11-07 10:13:26 × Frostillicus quits (~Frostilli@pool-71-174-119-69.bstnma.fios.verizon.net) (Ping timeout: 244 seconds)
2025-11-07 10:15:25 <__monty__> And none of the alternatives is actually shorter than `\f -> asum . map f`.
2025-11-07 10:16:41 trickard_ is now known as trickard
2025-11-07 10:20:27 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
2025-11-07 10:25:20 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds)
2025-11-07 10:30:28 × itaipu quits (~itaipu@168.121.97.28) (Ping timeout: 260 seconds)
2025-11-07 10:36:14 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
2025-11-07 10:41:43 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 264 seconds)
2025-11-07 10:45:40 Zemy_ joins (~Zemy@2600:100c:b0a1:9f27:38d4:16ff:fedd:d703)
2025-11-07 10:45:40 × Zemy quits (~Zemy@72.178.108.235) (Read error: Connection reset by peer)
2025-11-07 10:46:12 Zemy joins (~Zemy@72.178.108.235)
2025-11-07 10:49:57 × Zemy_ quits (~Zemy@2600:100c:b0a1:9f27:38d4:16ff:fedd:d703) (Ping timeout: 260 seconds)
2025-11-07 10:52:01 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
2025-11-07 10:53:00 Lycurgus joins (~juan@user/Lycurgus)
2025-11-07 10:53:55 Zemy_ joins (~Zemy@2600:100c:b0a1:9f27:4085:11ff:fe99:8799)
2025-11-07 10:53:56 × Zemy quits (~Zemy@72.178.108.235) (Read error: Connection reset by peer)
2025-11-07 10:54:29 Zemy joins (~Zemy@72.178.108.235)
2025-11-07 10:56:11 Core5925 joins (~Zemy@2600:100c:b0a1:9f27:7060:ffff:fe7d:6622)
2025-11-07 10:56:11 × Zemy quits (~Zemy@72.178.108.235) (Read error: Connection reset by peer)
2025-11-07 10:56:26 lisbeths joins (uid135845@id-135845.lymington.irccloud.com)
2025-11-07 10:56:44 Zemy joins (~Zemy@72.178.108.235)
2025-11-07 10:57:01 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 264 seconds)
2025-11-07 10:58:13 × Zemy_ quits (~Zemy@2600:100c:b0a1:9f27:4085:11ff:fe99:8799) (Ping timeout: 246 seconds)
2025-11-07 11:00:53 × Core5925 quits (~Zemy@2600:100c:b0a1:9f27:7060:ffff:fe7d:6622) (Ping timeout: 265 seconds)
2025-11-07 11:01:01 × trickard quits (~trickard@cpe-57-98-47-163.wireline.com.au) (Ping timeout: 246 seconds)
2025-11-07 11:01:38 trickard_ joins (~trickard@cpe-57-98-47-163.wireline.com.au)
2025-11-07 11:05:40 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
2025-11-07 11:10:33 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 265 seconds)
2025-11-07 11:15:38 Frostillicus joins (~Frostilli@pool-71-174-119-69.bstnma.fios.verizon.net)
2025-11-07 11:18:01 trickard_ is now known as trickard
2025-11-07 11:21:11 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
2025-11-07 11:26:07 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 264 seconds)
2025-11-07 11:36:59 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
2025-11-07 11:41:35 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds)
2025-11-07 11:43:27 × szkl quits (uid110435@id-110435.uxbridge.irccloud.com) (Quit: Connection closed for inactivity)
2025-11-07 11:52:45 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
2025-11-07 11:57:37 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 260 seconds)
2025-11-07 12:00:24 <dminuoso> 09:57:02 __monty__ │ It's slightly annoying when you have to litter the codebase with comments to disable lints.
2025-11-07 12:00:28 <dminuoso> Reconsider your life choices then.
2025-11-07 12:00:58 <dminuoso> It feels like some people have become mindless slaves to their linter, rather than just explicitly picking the things they want linting for.
2025-11-07 12:03:59 <__monty__> I'm talking about lints I want in general, just not in specific instances.
2025-11-07 12:05:22 <kuribas> dminuoso: you mean you do opt-in, rather than opt-out?
2025-11-07 12:06:05 <dminuoso> __monty__: Sure, cant you just disable/enable the things in some global linter config?
2025-11-07 12:06:36 <dminuoso> kuribas: It's slightly deeper than that. I'm just talking about a conscious choice.
2025-11-07 12:06:43 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
2025-11-07 12:06:48 <dminuoso> Whether that is made implicitly in an opt-out fashion or opt-in is just irrelevant.
2025-11-07 12:07:33 <kuribas> Yeah, I don't like mindlessly accepting linter choices, even in Python, but my colleage thought me "picky" :)
2025-11-07 12:10:11 <dminuoso> Every time I meet people using linters they subject themselves to a linter out of some belief that "whatever the linter does" is just "best practices".
2025-11-07 12:10:35 <dminuoso> Immanuel Kant talked at great lengths about this in in his essay "What is enlightenment"
2025-11-07 12:10:57 <dminuoso> He just didn't know about linters back then, he surely would have included it had he known.
2025-11-07 12:11:43 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 264 seconds)
2025-11-07 12:16:03 × [_________] quits (~oos95GWG@user/oos95GWG) (Ping timeout: 260 seconds)
2025-11-07 12:16:03 × vulpine quits (xfnw@user/meow/xfnw) (Ping timeout: 260 seconds)
2025-11-07 12:16:10 <kuribas> I am fine with a curated list decided by the team.
2025-11-07 12:16:37 [_________] joins (~oos95GWG@user/oos95GWG)
2025-11-07 12:21:26 Square3 joins (~Square@user/square)
2025-11-07 12:22:09 Square2 joins (~Square4@user/square)
2025-11-07 12:22:27 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)

All times are in UTC.