Newest at the top
2024-05-16 22:59:13 +0200 | danza | (~francesco@rm-19-5-133.service.infuturo.it) (Ping timeout: 246 seconds) |
2024-05-16 22:58:09 +0200 | mei | (~mei@user/mei) (Remote host closed the connection) |
2024-05-16 22:54:53 +0200 | danza | (~francesco@rm-19-5-133.service.infuturo.it) |
2024-05-16 22:52:36 +0200 | kadir | (~kadir@88.251.51.100) (Quit: WeeChat 4.2.2) |
2024-05-16 22:51:00 +0200 | danse-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 +0200 | machinedgod | (~machinedg@d173-183-246-216.abhsia.telus.net) |
2024-05-16 22:44:24 +0200 | ChaiTRex | (~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 +0200 | califax_ | califax |
2024-05-16 22:41:03 +0200 | califax_ | (~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 +0200 | ChaiTRex | (~ChaiTRex@user/chaitrex) (Ping timeout: 260 seconds) |
2024-05-16 22:40:50 +0200 | califax | (~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 +0200 | waleee | (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) |
2024-05-16 22:35:34 +0200 | EvanR_ | 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 |
2024-05-16 22:30:44 +0200 | pavonia | (~user@user/siracusa) |
2024-05-16 22:28:41 +0200 | <talismanick> | glguy: yeah, that looks right... am I missing something obvious about why this is wrong? |
2024-05-16 22:27:51 +0200 | <talismanick> | ski: do you think I maybe need to add some newtype wrappers using Ap to lift Monoid to Alternative? |
2024-05-16 22:27:50 +0200 | <glguy> | so this? instance Monoid e => Alternative (Either e) where empty = Left mempty; Right x <|> _ = Right x; _ <|> Right x = Right x; Left x <|> Left y = Left (x <> y) |
2024-05-16 22:27:04 +0200 | <talismanick> | (deriving these instances for the reversible Printer type, that is) |
2024-05-16 22:26:12 +0200 | <talismanick> | relaxing the <4.13 constraint went smoothly, except that newtype-deriving the all-important Alternative and MonadPlus failed with the error "no instance for MonadPlus (Either String)" |
2024-05-16 22:25:39 +0200 | <ski> | (doesn't seem to be one for `Alternative', though) |
2024-05-16 22:25:29 +0200 | <ski> | hmm .. i see `Monoid e => Monoid (Validation e a)' |
2024-05-16 22:24:35 +0200 | <talismanick> | for context, I'm playing around with a package promising bidirectional parsing <-> prettyprinting on the basis of monadic profunctoriality, but it's bitrotted as GHC has evolved |
2024-05-16 22:22:31 +0200 | <talismanick> | Is it something to do with kind, as in biasing a choice so it then acts "as if" it were `* -> *` like `Maybe` breaks some law I haven't thought of yet? |
2024-05-16 22:22:28 +0200 | <talismanick> | Why is there no `Monoid e -> Alternative (Either e)` instance? |
2024-05-16 22:13:45 +0200 | sord937 | (~sord937@gateway/tor-sasl/sord937) (Quit: sord937) |
2024-05-16 22:10:44 +0200 | kadir | (~kadir@88.251.51.100) |
2024-05-16 22:10:15 +0200 | talismanick | (~user@2601:644:937c:ed10::ae5) |
2024-05-16 22:09:06 +0200 | danse-nr3 | (~danse-nr3@rm-19-5-133.service.infuturo.it) |
2024-05-16 22:08:56 +0200 | danse-nr3 | (~danse-nr3@151.47.136.223) (Read error: Connection reset by peer) |
2024-05-16 22:02:23 +0200 | L29Ah | (~L29Ah@wikipedia/L29Ah) |
2024-05-16 22:00:54 +0200 | L29Ah | (~L29Ah@wikipedia/L29Ah) () |
2024-05-16 21:58:57 +0200 | L29Ah | (~L29Ah@wikipedia/L29Ah) |
2024-05-16 21:57:47 +0200 | raehik | (~raehik@rdng-25-b2-v4wan-169990-cust1344.vm39.cable.virginm.net) (Ping timeout: 256 seconds) |
2024-05-16 21:56:36 +0200 | wootehfoot | (~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer) |
2024-05-16 21:52:22 +0200 | philopsos | (~caecilius@user/philopsos) (Ping timeout: 246 seconds) |