Newest at the top
2025-02-28 22:01:47 +0100 | k_hachig_ | (~k_hachig@138-51-74-124-lsn-2.nat.utoronto.ca) k_hachig |
2025-02-28 22:00:12 +0100 | weary-traveler | (~user@user/user363627) user363627 |
2025-02-28 21:59:17 +0100 | L29Ah | (~L29Ah@wikipedia/L29Ah) L29Ah |
2025-02-28 21:56:52 +0100 | ash3en | (~Thunderbi@146.70.124.222) ash3en |
2025-02-28 21:55:23 +0100 | <danso> | it seems a useful pattern |
2025-02-28 21:54:59 +0100 | jmcantrell_ | jmcantrell |
2025-02-28 21:54:59 +0100 | jmcantrell | (~weechat@user/jmcantrell) (Ping timeout: 260 seconds) |
2025-02-28 21:54:56 +0100 | <danso> | "disjunction monoids"? idk |
2025-02-28 21:52:40 +0100 | <ncf> | your `choose_str str1 str2 = if null str1 then str2 else str1` is an example of that, but that's not the usual list monoid |
2025-02-28 21:52:21 +0100 | <ncf> | those are free monoids on left zero semigroups |
2025-02-28 21:52:06 +0100 | alfiee | (~alfiee@user/alfiee) (Ping timeout: 244 seconds) |
2025-02-28 21:51:17 +0100 | <tomsmeding> | I've never heard a name specifically for those _kinds_ of monoids |
2025-02-28 21:50:48 +0100 | <danso> | tomsmeding, First is what i'm talking about for Maybe, but it won't generalise to [] or whatever |
2025-02-28 21:50:08 +0100 | <tomsmeding> | takes the first result of a bunch of Maybes |
2025-02-28 21:50:02 +0100 | k_hachig_ | (~k_hachig@138-51-74-124-lsn-2.nat.utoronto.ca) (Ping timeout: 244 seconds) |
2025-02-28 21:49:51 +0100 | <tomsmeding> | danso: the First monoid exists |
2025-02-28 21:49:45 +0100 | <Rembane> | Oh |
2025-02-28 21:49:38 +0100 | <tomsmeding> | it requires a Maybe otherwise it's not a monoid, just a semigroup |
2025-02-28 21:49:31 +0100 | <lambdabot> | First {getFirst = Just 2} |
2025-02-28 21:49:30 +0100 | <tomsmeding> | > First (Just 2) <> First (Just 3) |
2025-02-28 21:49:27 +0100 | <Rembane> | Meh |
2025-02-28 21:49:26 +0100 | <danso> | but i guess it's pretty hard to nail down exactly what they are |
2025-02-28 21:49:25 +0100 | <lambdabot> | • In the first argument of ‘First’, namely ‘'a'’ |
2025-02-28 21:49:25 +0100 | <lambdabot> | • Couldn't match expected type ‘Maybe a’ with actual type ‘Char’ |
2025-02-28 21:49:25 +0100 | <lambdabot> | error: |
2025-02-28 21:49:24 +0100 | <Rembane> | > First 'a' <> First 'b' |
2025-02-28 21:49:18 +0100 | <lambdabot> | No module named ‘Data.Semigroup’ is imported.error: |
2025-02-28 21:49:18 +0100 | <lambdabot> | Not in scope: data constructor ‘Data.Semigroup.First’ |
2025-02-28 21:49:18 +0100 | <lambdabot> | error: |
2025-02-28 21:49:17 +0100 | <tomsmeding> | > Data.Semigroup.First 2 <> Data.Semigroup.First 3 |
2025-02-28 21:49:03 +0100 | <danso> | i was hoping somebody had given names to these patterns ("combining"/"first") |
2025-02-28 21:48:57 +0100 | Tuplanolla | (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) Tuplanolla |
2025-02-28 21:48:47 +0100 | <lambdabot> | • In the expression: e_123 |
2025-02-28 21:48:47 +0100 | <lambdabot> | • No instance for (Num (Maybe ())) arising from a use of ‘e_123’ |
2025-02-28 21:48:47 +0100 | <lambdabot> | error: |
2025-02-28 21:48:45 +0100 | <tomsmeding> | > First 2 <> First 3 |
2025-02-28 21:48:37 +0100 | <geekosaur> | nor are they mathematical properties as such |
2025-02-28 21:48:24 +0100 | <geekosaur> | yeh, and there's just no good way to provide both in Haskell |
2025-02-28 21:48:16 +0100 | <Rembane> | danso: Both of those are valid monoids. They're just different. |
2025-02-28 21:48:16 +0100 | <ncf> | but this is not a property of a monoid, it's an implementation detail |
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) |