Newest at the top
2024-07-07 17:42:39 +0200 | mikess | (~mikess@user/mikess) |
2024-07-07 17:40:54 +0200 | machinedgod | (~machinedg@d173-183-246-216.abhsia.telus.net) |
2024-07-07 17:19:03 +0200 | Square | (~Square@user/square) |
2024-07-07 17:17:22 +0200 | ubert1 | ubert |
2024-07-07 17:17:22 +0200 | ubert | (~Thunderbi@p200300ecdf008f0f0a6872e022c3958c.dip0.t-ipconnect.de) (Ping timeout: 268 seconds) |
2024-07-07 17:16:31 +0200 | ubert1 | (~Thunderbi@p200300ecdf008f0dcbf843fa6f22da0d.dip0.t-ipconnect.de) |
2024-07-07 17:15:25 +0200 | soverysour | (~soverysou@user/soverysour) |
2024-07-07 17:15:25 +0200 | soverysour | (~soverysou@81.196.150.219) (Changing host) |
2024-07-07 17:15:25 +0200 | soverysour | (~soverysou@81.196.150.219) |
2024-07-07 16:45:36 +0200 | __monty__ | (~toonn@user/toonn) |
2024-07-07 16:45:11 +0200 | soverysour | (~soverysou@user/soverysour) (Ping timeout: 272 seconds) |
2024-07-07 16:37:18 +0200 | Tuplanolla | (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) |
2024-07-07 16:35:33 +0200 | leah2 | (~leah@vuxu.org) |
2024-07-07 16:35:14 +0200 | qqe | (~qqq@92.43.167.61) (Quit: leaving) |
2024-07-07 16:12:37 +0200 | wlhn | (~wlhn@dl46fx8hbfttwvhb-h1ly-3.rev.dnainternet.fi) (Quit: Leaving) |
2024-07-07 16:04:17 +0200 | <tomsmeding> | but that really only replaces a very marginal bit of your code :p |
2024-07-07 16:03:51 +0200 | <tomsmeding> | that's a bit of Generics magic there |
2024-07-07 16:03:41 +0200 | <tomsmeding> | one could write a function that creates a D from some T if there's only one constructor of D that has a field of type T (possibly nested in Either), and furthermore that constructor of D has no other fields |
2024-07-07 16:02:43 +0200 | <tomsmeding> | you'd still need to provide a mapping from PkgManager to the constructors of Mode.PkgManager |
2024-07-07 16:02:23 +0200 | <tomsmeding> | still, what would the magical solution even do, precisely? |
2024-07-07 16:00:30 +0200 | <tomsmeding> | there's sensibility, and then there's fun :p |
2024-07-07 16:00:21 +0200 | poscat | (~poscat@user/poscat) |
2024-07-07 16:00:15 +0200 | <hololeap> | I kinda want to try the magical solution, just for the challenge, but you make good points :) |
2024-07-07 16:00:05 +0200 | poscat | (~poscat@user/poscat) (Quit: Bye) |
2024-07-07 15:58:59 +0200 | <tomsmeding> | even though semantically, nothing really changed |
2024-07-07 15:58:47 +0200 | <tomsmeding> | then suddenly the generics/Data/whatever magic would have to do inter-datatype analysis |
2024-07-07 15:58:26 +0200 | <tomsmeding> | what if there's another data type in between? |
2024-07-07 15:58:15 +0200 | <tomsmeding> | it's just a feeling that I have, but I suspect that the equivalence here (that ReinstallAtomsMode is a field of Portage precisely because it's valid with Portage) is somewhat accidental |
2024-07-07 15:57:37 +0200 | <tomsmeding> | to me that feels like a more appropriate solution here than trying to infer semantical structure from the data types |
2024-07-07 15:57:03 +0200 | <hololeap> | yeah, that makes sense |
2024-07-07 15:55:34 +0200 | <tomsmeding> | then you cut down on the combinatorial explosion |
2024-07-07 15:55:10 +0200 | <tomsmeding> | if so, perhaps you can have a separate function first that tries to combine the cmdLineMode and the cmdLineTarget into `Either RunMode ReinstallAtomsMode` |
2024-07-07 15:54:29 +0200 | <tomsmeding> | hololeap: am I correct that a "target" (whether it's a Target, a CustomTargets, or a ReinstallAtomsTarget) is always eventually a part of the "mode" (be it RunMode or ReinstallAtomsMode)? |
2024-07-07 15:53:01 +0200 | <hololeap> | and I was planning on adding a couple more for that mode, so the case statement is getting unruley. I suppose the best thing to do would be to make reinstall-atoms mode a separate command with its own options |
2024-07-07 15:51:01 +0200 | <tomsmeding> | right, I see |
2024-07-07 15:50:55 +0200 | <hololeap> | mostly, yes. however there is also a --target=... option which has a couple that are only valid with --mode=reinstall-atoms |
2024-07-07 15:48:41 +0200 | <tomsmeding> | in any case this whole thing is only really relevant for ReinstallAtomsMode, right? The others are orthogonal |
2024-07-07 15:48:08 +0200 | <hololeap> | maybe :p |
2024-07-07 15:48:00 +0200 | <tomsmeding> | s/make a/make a value of a/ |
2024-07-07 15:47:49 +0200 | <tomsmeding> | have I been unnecessarily hung up on the phrasing of your original question, where you asked for how to "check if" instead of how to make a data type given one of the fields? |
2024-07-07 15:46:51 +0200 | <hololeap> | the "reinstall-atoms" mode is something that only makes sense with the portage package manager, since it has the features to implement it. it's a special mode that I made with portage's features in mind |
2024-07-07 15:46:29 +0200 | <tomsmeding> | I see, so you're doing exactly what I was suggesting, in a way |
2024-07-07 15:45:06 +0200 | <hololeap> | https://github.com/gentoo-haskell/haskell-updater/blob/master/Distribution/Gentoo/Types/HUMode.hs |
2024-07-07 15:44:46 +0200 | <hololeap> | https://github.com/gentoo-haskell/haskell-updater/blob/master/Distribution/Gentoo/CmdLine.hs#L37-L99 |
2024-07-07 15:43:07 +0200 | <tomsmeding> | but then you need more than just the fact that ReinstallAtomsMode occurs within Portage, right? You also need a function that makes you a Portage given a ReinstallAtomsMode |
2024-07-07 15:42:29 +0200 | <hololeap> | that's actually what I was following. I have a model of all the possible command line combinations, and I'm trying to "parse" it into the ADT that encodes all the valid mode combinations |
2024-07-07 15:41:24 +0200 | <tomsmeding> | at the risk of cargo-culting, I'm trying to find out if this is a case where parse-don't-validate is applicable |
2024-07-07 15:40:47 +0200 | <tomsmeding> | Can you do the check _there_ instead of crashing? |
2024-07-07 15:40:39 +0200 | <tomsmeding> | would something crash? What would? |
2024-07-07 15:40:33 +0200 | <tomsmeding> | hololeap: okay sure, but what would happen if you'd just remove that case statement? |