2025/11/25

Newest at the top

2025-11-25 16:40:26 +0100 <merijn> Leary: Sure, but a required should've been that the mapping is dense and boundscheck should've made more sense
2025-11-25 16:39:38 +0100 <Leary> merijn: `(to|from)Enum` are easier to get right than the tricky details of the other methods, and should only be used to write them by proxy. You can argue that they shouldn't be part of the class (e.g. they could be written as local helpers on a per-instance basis and mapped over the methods of `Enum Int`), but then you lose the convenience of method defaults.
2025-11-25 16:34:57 +0100 <haskellbridge> <Morj> Otherwise I just write monomorphic functions for my own type that I need to convert to-from Int
2025-11-25 16:33:14 +0100 <haskellbridge> <Morj> The good thing about Enum is that fromEnum @Char is exported in prelude, and ord isn't
2025-11-25 16:31:15 +0100sindu(~sindu@2.148.32.207.tmi.telenormobil.no)
2025-11-25 16:31:15 +0100weary-traveler(~user@user/user363627) (Ping timeout: 240 seconds)
2025-11-25 16:30:50 +0100 <merijn> I dunno what happened in my brain there, glitching two conversations together xD
2025-11-25 16:30:38 +0100 <merijn> -AI+class
2025-11-25 16:29:54 +0100 <merijn> Leary: The AI going through Int but not ensuring that's safe is definitely bad
2025-11-25 16:28:45 +0100 <dutchie> if i was going to refactor I think it'd make sense to have my bounds in a Reader somewhere
2025-11-25 16:27:51 +0100 <dutchie> yeah it's almost certainly overkill to have it that generic
2025-11-25 16:27:28 +0100Fischmiep(~Fischmiep@user/Fischmiep) Fischmiep
2025-11-25 16:27:25 +0100 <Leary> dutchie: Rather than trying to be generic in `Enum`, perhaps just use `Int` with explicit bounds? That can always be generalised to `Enum a` if you really need it to.
2025-11-25 16:26:55 +0100Googulator(~Googulato@2a01-036d-0106-4ad8-11e2-562e-881b-eb37.pool6.digikabel.hu)
2025-11-25 16:26:36 +0100 <Leary> `class Enum` is an implementation detail of `[a(, b) .. (c)]` notation, and `(to|from)Enum` of the necessary `enumFrom*` methods. What's bad is that these details aren't hidden, inviting abuse. `succ`/`pred`, which are thrown in on principle, are perhaps the only truly user-facing part of the class.
2025-11-25 16:25:52 +0100Fischmiep(~Fischmiep@user/Fischmiep) (Quit: ZNC - https://znc.in)
2025-11-25 16:24:56 +0100Square3(~Square@user/square) Square
2025-11-25 16:23:36 +0100srazkvt(~sarah@user/srazkvt) (Quit: Konversation terminated!)
2025-11-25 16:19:49 +0100 <dutchie> nudge a square on a grid, so Maybe Neighbour
2025-11-25 16:19:02 +0100trickard_trickard
2025-11-25 16:18:51 +0100 <merijn> dutchie: What are you using maybeToEnum for?
2025-11-25 16:18:25 +0100 <dutchie> at least these are my own Enum instances (faking a bounded Int class) and so I know they are dense
2025-11-25 16:17:52 +0100 <lambdabot> concatMap (\ a -> case a of { Just x -> [x]; _ -> []}) xs
2025-11-25 16:17:52 +0100 <alex`> @undo [x | Just x <- xs]
2025-11-25 16:17:39 +0100alex`(~user@251.red-83-33-249.dynamicip.rima-tde.net)
2025-11-25 16:15:04 +0100 <merijn> Enum is an awful, awful class and it should feel bad
2025-11-25 16:14:56 +0100 <merijn> Like I said
2025-11-25 16:14:41 +0100 <dutchie> ah true, even worse
2025-11-25 16:14:15 +0100 <merijn> dutchie: Incidentally, that may *still* fail, if the enum instance isn't dense
2025-11-25 16:13:28 +0100 <haskellbridge> <Zemyla> In addition to the standard parens function, there should be a parens', which is guaranteed to parse all parentheses.
2025-11-25 16:13:23 +0100 <merijn> Enum is an awful awful class and it should feel bad >.>
2025-11-25 16:12:51 +0100 <dutchie> https://paste.tomsmeding.com/MLNFAoXl this feels dumb
2025-11-25 16:05:51 +0100td_(~td@i5387092E.versanet.de)
2025-11-25 16:05:14 +0100potatoespotatoes(~quassel@user/potatoespotatoes) potatoespotatoes
2025-11-25 16:04:52 +0100potatoespotatoes(~quassel@user/potatoespotatoes) (Client Quit)
2025-11-25 16:01:34 +0100merijn(~merijn@77.242.116.146) merijn
2025-11-25 16:00:40 +0100potatoespotatoes(~quassel@user/potatoespotatoes) potatoespotatoes
2025-11-25 15:58:17 +0100potatoespotatoes(~quassel@user/potatoespotatoes) ()
2025-11-25 15:55:23 +0100itaipu(~itaipu@168.121.97.28) itaipu
2025-11-25 15:55:15 +0100Googulator85(~Googulato@2a01-036d-0106-01f1-f56c-45b8-e3c8-fdbd.pool6.digikabel.hu) (Ping timeout: 250 seconds)
2025-11-25 15:49:18 +0100kritzefitz(~kritzefit@debian/kritzefitz) (Ping timeout: 252 seconds)
2025-11-25 15:46:32 +0100comerijn(~merijn@77.242.116.146) (Ping timeout: 240 seconds)
2025-11-25 15:45:50 +0100Googulator73(~Googulato@2a01-036d-0106-01f1-f56c-45b8-e3c8-fdbd.pool6.digikabel.hu) (Quit: Client closed)
2025-11-25 15:45:45 +0100Googulator85(~Googulato@2a01-036d-0106-01f1-f56c-45b8-e3c8-fdbd.pool6.digikabel.hu)
2025-11-25 15:43:29 +0100trickard_(~trickard@cpe-92-98-47-163.wireline.com.au)
2025-11-25 15:43:14 +0100trickard_(~trickard@cpe-92-98-47-163.wireline.com.au) (Read error: Connection reset by peer)
2025-11-25 15:42:04 +0100itaipu(~itaipu@168.121.97.28) (Ping timeout: 256 seconds)
2025-11-25 15:38:51 +0100CiaoSen(~Jura@2a02:8071:64e1:da0:5a47:caff:fe78:33db) (Ping timeout: 252 seconds)
2025-11-25 15:33:09 +0100humasect(~humasect@dyn-192-249-132-90.nexicom.net) humasect
2025-11-25 15:30:55 +0100hseg_(~hseg_@46.120.21.70) hseg