2025/02/10

Newest at the top

2025-02-10 15:13:32 +0100 <haskellbridge> <Profpatsch> Which fits it into my actual parsing interface
2025-02-10 15:13:24 +0100 <haskellbridge> <Profpatsch> dminuoso: I had this as well https://hackage.haskell.org/package/pa-field-parser-0.3.0.0/docs/FieldParser.html#v:invertPretty
2025-02-10 15:12:39 +0100 <haskellbridge> <Profpatsch> yeah
2025-02-10 15:12:32 +0100 <dminuoso> For the large general case, if you have loads of these and want optimal performance I would use TH anyway.
2025-02-10 15:12:15 +0100 <haskellbridge> <Profpatsch> I originally copied it from relude i think
2025-02-10 15:11:58 +0100 <dminuoso> I've already adapted it to use Data.List and simplified it a bit.
2025-02-10 15:11:52 +0100 <haskellbridge> <Profpatsch> yeah
2025-02-10 15:11:47 +0100 <dminuoso> Profpatsch: I think you meant List.lookup/Map.lookup rather than elem, but yeah.
2025-02-10 15:11:07 +0100acidjnk_new3(~acidjnk@p200300d6e7283f99c4dbaee3a15423f1.dip0.t-ipconnect.de) (Ping timeout: 268 seconds)
2025-02-10 15:11:02 +0100 <haskellbridge> <Profpatsch> Cause scanning a list is lower overhead at small size
2025-02-10 15:10:50 +0100 <haskellbridge> <Profpatsch> dminuoso: now that I think about this, since usually the difference between maxBound and minBound is small for enums, using List.elem instead of Map.elem should be better actually
2025-02-10 15:06:33 +0100weary-traveler(~user@user/user363627) user363627
2025-02-10 15:05:16 +0100 <dminuoso> Profpatsch: Oh, so simple and effective. I had not thought of Bounded.
2025-02-10 15:04:50 +0100tri(~tri@ool-44c70bcb.dyn.optonline.net) (Ping timeout: 244 seconds)
2025-02-10 15:03:21 +0100 <haskellbridge> <Profpatsch> dminuoso: https://code.tvl.fyi/tree/users/Profpatsch/my-prelude/src/MyPrelude.hs#n695
2025-02-10 15:00:36 +0100tri(~tri@ool-44c70bcb.dyn.optonline.net)
2025-02-10 14:57:00 +0100misterfish(~misterfis@31-161-39-137.biz.kpn.net) (Ping timeout: 252 seconds)
2025-02-10 14:55:58 +0100causal(~eric@50.35.84.231) (Quit: WeeChat 4.5.1)
2025-02-10 14:48:06 +0100vanishingideal(~vanishing@user/vanishingideal) vanishingideal
2025-02-10 14:46:14 +0100vanishingideal(~vanishing@user/vanishingideal) (Ping timeout: 244 seconds)
2025-02-10 14:46:13 +0100CryptLab(NSA@gateway/vpn/protonvpn/commanderbond007) CommanderBond007
2025-02-10 14:44:08 +0100alfiee(~alfiee@user/alfiee) (Ping timeout: 245 seconds)
2025-02-10 14:43:19 +0100CryptLab(NSA@gateway/vpn/protonvpn/commanderbond007) (Read error: Connection reset by peer)
2025-02-10 14:39:46 +0100alfiee(~alfiee@user/alfiee) alfiee
2025-02-10 14:37:04 +0100tnt2tnt1
2025-02-10 14:37:04 +0100tnt1(~Thunderbi@user/tnt1) (Ping timeout: 260 seconds)
2025-02-10 14:37:02 +0100tnt2(~Thunderbi@user/tnt1) tnt1
2025-02-10 14:35:23 +0100bitdex(~bitdex@gateway/tor-sasl/bitdex) (Quit: = "")
2025-02-10 14:33:48 +0100sprotte24(~sprotte24@p200300d16f2cc700d9ccd33fac989807.dip0.t-ipconnect.de) (Quit: Leaving)
2025-02-10 14:30:38 +0100zero(~z@user/zero) zero
2025-02-10 14:28:23 +0100zwro(~z@user/zero) (Ping timeout: 252 seconds)
2025-02-10 14:20:08 +0100wootehfoot(~wootehfoo@user/wootehfoot) wootehfoot
2025-02-10 14:18:36 +0100 <int-e> (bonus point if the "qlign" was intentional)
2025-02-10 14:13:42 +0100 <dminuoso> TH is an obvious solution, but its not some simple 2-liner I want to include in every poroject
2025-02-10 14:13:21 +0100 <dminuoso> So then I keep thinking about just writing an assoc list [(Started, "started"), ("Stopped", "stopped")], but then pattern match exhaustiveness is not on my side.
2025-02-10 14:12:51 +0100 <dminuoso> Which by itself is fine, but when I write a FromField, there's the potential for typos such that they dont qlign.
2025-02-10 14:12:29 +0100 <dminuoso> Instead I usually do something like `toField s = case s of Started -> toField "started"; Stopped -> toField "stopped"`
2025-02-10 14:11:53 +0100 <dminuoso> Oh here's a curious question that I come back to a few times a year. Everytime I cook up a ToField/FromField class, I generally dont want to use Show/Read for serialization as I want the freedom to rename.
2025-02-10 14:06:13 +0100merijn(~merijn@77.242.116.146) merijn
2025-02-10 14:06:03 +0100merijn(~merijn@77.242.116.146) (Ping timeout: 246 seconds)
2025-02-10 14:01:06 +0100merijn(~merijn@77.242.116.146) merijn
2025-02-10 14:00:28 +0100merijn(~merijn@77.242.116.146) (Ping timeout: 244 seconds)
2025-02-10 13:56:49 +0100alfiee(~alfiee@user/alfiee) (Ping timeout: 260 seconds)
2025-02-10 13:55:46 +0100CiaoSen(~Jura@ip-037-201-241-067.um10.pools.vodafone-ip.de) (Ping timeout: 252 seconds)
2025-02-10 13:53:00 +0100otbergsten(~otbergste@user/otbergsten) otbergsten
2025-02-10 13:52:02 +0100alfiee(~alfiee@user/alfiee) alfiee
2025-02-10 13:47:46 +0100ljdarj(~Thunderbi@user/ljdarj) ljdarj
2025-02-10 13:44:33 +0100sprotte24(~sprotte24@p200300d16f2cc700d9ccd33fac989807.dip0.t-ipconnect.de)
2025-02-10 13:40:50 +0100tri(~tri@ool-44c70bcb.dyn.optonline.net) (Ping timeout: 265 seconds)
2025-02-10 13:36:17 +0100tri(~tri@ool-44c70bcb.dyn.optonline.net)