2024/05/16

Newest at the top

2024-05-16 23:31:46 +0200peterbecich(~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 246 seconds)
2024-05-16 23:27:20 +0200peterbecich(~Thunderbi@syn-047-229-123-186.res.spectrum.com)
2024-05-16 23:21:40 +0200 <ncf> from experience this will not be an easy task
2024-05-16 23:21:14 +0200 <ncf> i mean if you want to convince the Core Libraries Committee that this is the one true God-intended instance for Alternative (Either e), go for it
2024-05-16 23:21:04 +0200sawilagar(~sawilagar@user/sawilagar)
2024-05-16 23:20:12 +0200 <talismanick> ...but it's not unlawful, and there's precedent for English bias anyways
2024-05-16 23:19:07 +0200 <ncf> so it has to pick one, and left seems like the favoured one because english
2024-05-16 23:18:54 +0200philopsos1(~caecilius@user/philopsos)
2024-05-16 23:18:38 +0200 <ncf> but Either can't just concatenate the Rights, since it has to work parametrically in a
2024-05-16 23:18:35 +0200 <talismanick> oh, true
2024-05-16 23:18:23 +0200 <ncf> i mean Alternative [] isn't left-biased
2024-05-16 23:18:21 +0200 <talismanick> and, why isn't `Monoid e => Alternative (Either e)` in base, then? That seems like a reasonably conservative-but-useful addition
2024-05-16 23:17:20 +0200 <talismanick> ncf: isn't Alternative generally left-biased on mutual success? (pick `Right a` and bail)
2024-05-16 23:16:11 +0200polyphem(~rod@p4fc2c1da.dip0.t-ipconnect.de) (Ping timeout: 260 seconds)
2024-05-16 23:15:05 +0200oo_miguel(~Thunderbi@78-11-181-16.static.ip.netia.com.pl)
2024-05-16 23:14:07 +0200machinedgod(~machinedg@d173-183-246-216.abhsia.telus.net) (Ping timeout: 268 seconds)
2024-05-16 23:13:46 +0200takuan(~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
2024-05-16 23:10:37 +0200m257(~maaz@bras-base-hspron0502w-grc-15-174-92-92-146.dsl.bell.ca)
2024-05-16 23:10:13 +0200ph88(~ph88@2a02:8109:9e26:c800:801e:36ad:9367:33b9) (Remote host closed the connection)
2024-05-16 23:04:37 +0200mei(~mei@user/mei)
2024-05-16 23:02:45 +0200johnw(~johnw@69.62.242.138)
2024-05-16 23:02:19 +0200johnw(~johnw@69.62.242.138) (Quit: ZNC - http://znc.in)
2024-05-16 22:59:13 +0200danza(~francesco@rm-19-5-133.service.infuturo.it) (Ping timeout: 246 seconds)
2024-05-16 22:58:09 +0200mei(~mei@user/mei) (Remote host closed the connection)
2024-05-16 22:54:53 +0200danza(~francesco@rm-19-5-133.service.infuturo.it)
2024-05-16 22:52:36 +0200kadir(~kadir@88.251.51.100) (Quit: WeeChat 4.2.2)
2024-05-16 22:51:00 +0200danse-nr3(~danse-nr3@rm-19-5-133.service.infuturo.it) (Ping timeout: 255 seconds)
2024-05-16 22:50:15 +0200 <ncf> and it's not like there's a canonical monoid on every type (as opposed to the First semigroup), so you just make it a Monoid e constraint
2024-05-16 22:49:42 +0200 <ncf> AFAICT you only have to choose a monoid for e and whether to keep the left or the right in Right a <|> Right b
2024-05-16 22:49:07 +0200 <ncf> i'm not sure there are that many options for Alternative (Either e) tbh
2024-05-16 22:47:20 +0200machinedgod(~machinedg@d173-183-246-216.abhsia.telus.net)
2024-05-16 22:44:24 +0200ChaiTRex(~ChaiTRex@user/chaitrex)
2024-05-16 22:42:21 +0200 <talismanick> fair enough
2024-05-16 22:42:15 +0200 <glguy> If I'm using transformers it's behind a newtype
2024-05-16 22:42:09 +0200 <talismanick> I mean, say what you will about transformer stacks with tons of parameters, lens signatures, etc, but I feel like Except is universally understood
2024-05-16 22:42:07 +0200califax_califax
2024-05-16 22:41:03 +0200califax_(~califax@user/califx)
2024-05-16 22:41:01 +0200 <talismanick> if anything, that's all the stronger an argument for getting rid of (Either String) and using the transformers package, given that a homegrown error type is liable to be a source of problems itself
2024-05-16 22:40:50 +0200ChaiTRex(~ChaiTRex@user/chaitrex) (Ping timeout: 260 seconds)
2024-05-16 22:40:50 +0200califax(~califax@user/califx) (Ping timeout: 260 seconds)
2024-05-16 22:38:53 +0200 <glguy> The nice solution is to make a new datatype with documented behaviors you rely on. Piecing together behaviors from generic types can be nice in a pinch but it's challenging for the future reader to know what properties of the generic thing are being relied upon later
2024-05-16 22:38:43 +0200 <talismanick> err, Except
2024-05-16 22:37:24 +0200 <talismanick> I mean, I guess that's a win for convenient typeclass polymorphism anyways
2024-05-16 22:36:53 +0200 <talismanick> so, the right solution is probably to tear out Either altogether and use Error from transformers?
2024-05-16 22:35:53 +0200waleee(~waleee@h-176-10-144-38.NA.cust.bahnhof.se)
2024-05-16 22:35:34 +0200EvanR_EvanR
2024-05-16 22:33:56 +0200 <glguy> I think there are just too many options for there to be a sensible implementation. Picking one arbitrarily will just lead to surprise bugs
2024-05-16 22:32:00 +0200 <ncf> https://gitlab.haskell.org/ghc/ghc/-/issues/9588
2024-05-16 22:31:45 +0200 <talismanick> (if we get Bialternative and it lets us do what we wanted from Alternative/MonadPlus)
2024-05-16 22:31:00 +0200 <talismanick> there is https://github.com/ekmett/bifunctors/issues/126 in the works, which might be enough