Newest at the top
2025-02-28 21:47:56 +0100 | alfiee | (~alfiee@user/alfiee) alfiee |
2025-02-28 21:47:42 +0100 | remedan | (~remedan@ip-62-245-108-153.bb.vodafone.cz) remedan |
2025-02-28 21:47:38 +0100 | <danso> | right geekosaur, in my mind "combining" monoids are usually the most obvious choice, but also "first which succeeds (for some definition of success)" is often useful too |
2025-02-28 21:47:27 +0100 | peterbecich | (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 244 seconds) |
2025-02-28 21:47:03 +0100 | remedan | (~remedan@ip-62-245-108-153.bb.vodafone.cz) (Quit: Bye!) |
2025-02-28 21:46:44 +0100 | <geekosaur> | which one gets picked for any given type is somewhat arbitrary but generally guided by usefulness |
2025-02-28 21:46:42 +0100 | <monochrom> | "ticket closed" |
2025-02-28 21:46:36 +0100 | weary-traveler | (~user@user/user363627) (Remote host closed the connection) |
2025-02-28 21:46:35 +0100 | misterfish | (~misterfis@84.53.85.146) misterfish |
2025-02-28 21:46:24 +0100 | <monochrom> | So, Alt Nothing <> Alt (Just 5) = Alt (Just 5) |
2025-02-28 21:46:21 +0100 | <geekosaur> | the problem here is that many types have many (sometimes infinitely many) monoids, but Haskell has to pick one |
2025-02-28 21:45:41 +0100 | <monochrom> | the wrapper is Alt. If Alterative T, then Monoid (Alt T a). |
2025-02-28 21:45:09 +0100 | <danso> | at the end of the file there's a function `composeRoutes` which does what i was expecting (<>) to do |
2025-02-28 21:44:39 +0100 | <danso> | `r1 <> r2` will choose the first route if it "succeeds", and otherwise choose the second route |
2025-02-28 21:43:46 +0100 | <ncf> | an example of what? it's just a monoid |
2025-02-28 21:43:45 +0100 | k_hachig_ | (~k_hachig@138-51-74-124-lsn-2.nat.utoronto.ca) k_hachig |
2025-02-28 21:43:42 +0100 | <monochrom> | OK there is a newtype wrapper, I'm looking it up. |
2025-02-28 21:43:24 +0100 | <monochrom> | OK, but if instance Alternative T, then Monoid (T a). |
2025-02-28 21:43:16 +0100 | <danso> | https://hackage.haskell.org/package/hakyll-4.16.6.0/docs/src/Hakyll.Core.Routes.html#Routes |
2025-02-28 21:43:14 +0100 | peterbecich | (~Thunderbi@syn-047-229-123-186.res.spectrum.com) peterbecich |
2025-02-28 21:43:11 +0100 | <danso> | the hakyll Routes monoid instance is an example of this, even tho Routes also has a compose function which combines two routes |
2025-02-28 21:43:00 +0100 | <tomsmeding> | but it's not *, it's on * -> * |
2025-02-28 21:42:42 +0100 | <monochrom> | It's Alternative. Nothing <|> Just 5 = Just 5. |
2025-02-28 21:42:25 +0100 | <Rembane> | danso: Just out of curiosity, what do you want to use this enhanced monoid for? |
2025-02-28 21:42:04 +0100 | <ncf> | i am not following. what is the common pattern here? |
2025-02-28 21:41:00 +0100 | <danso> | yes Rembane, exactly |
2025-02-28 21:40:42 +0100 | <danso> | UH that function should be called `or` ... |
2025-02-28 21:40:41 +0100 | <Rembane> | danso: Like monoids with some other preference than left associativity? |
2025-02-28 21:40:26 +0100 | weary-traveler | (~user@user/user363627) user363627 |
2025-02-28 21:39:55 +0100 | <danso> | or `and b1 b2 = if b1 then True else b2` |
2025-02-28 21:39:31 +0100 | <ncf> | huh? |
2025-02-28 21:37:13 +0100 | <danso> | as in the function `choose_str str1 str2 = if null str1 then str2 else str1` |
2025-02-28 21:37:05 +0100 | <danso> | is there a name for monoids which choose "something" over nothing, with kind *? |
2025-02-28 21:36:06 +0100 | lxsameer | (~lxsameer@Serene/lxsameer) (Ping timeout: 246 seconds) |
2025-02-28 21:33:34 +0100 | azenna | (~azenna@user/azenna) (Ping timeout: 260 seconds) |
2025-02-28 21:32:24 +0100 | k_hachig_ | (~k_hachig@138-51-74-124-lsn-2.nat.utoronto.ca) (Ping timeout: 260 seconds) |
2025-02-28 21:20:11 +0100 | zungi | (~tory@user/andrewchawk) andrewchawk |
2025-02-28 21:20:06 +0100 | k_hachig_ | (~k_hachig@138-51-74-124-lsn-2.nat.utoronto.ca) k_hachig |
2025-02-28 21:19:14 +0100 | azenna | (~azenna@user/azenna) azenna |
2025-02-28 21:19:14 +0100 | azenna | (~azenna@76.78.190.80) (Changing host) |
2025-02-28 21:17:17 +0100 | azenna | (~azenna@76.78.190.80) |
2025-02-28 21:17:03 +0100 | zenna | (~zenna@76.78.190.80) (Client Quit) |
2025-02-28 21:16:24 +0100 | zenna | (~zenna@76.78.190.80) |
2025-02-28 21:15:51 +0100 | halloy-user | (~halloy-us@76.78.190.80) (Client Quit) |
2025-02-28 21:15:37 +0100 | halloy-user | (~halloy-us@76.78.190.80) |
2025-02-28 21:13:13 +0100 | JuanDaugherty | (~juan@user/JuanDaugherty) JuanDaugherty |
2025-02-28 21:12:29 +0100 | misterfish | (~misterfis@84.53.85.146) (Ping timeout: 265 seconds) |
2025-02-28 21:10:26 +0100 | julie_pilgrim | (~julie_pil@user/julie-pilgrim/x-1240752) (Remote host closed the connection) |
2025-02-28 21:05:31 +0100 | alfiee | (~alfiee@user/alfiee) (Ping timeout: 252 seconds) |
2025-02-28 21:03:12 +0100 | zungi | (~tory@user/andrewchawk) (Ping timeout: 264 seconds) |