2025/04/01

Newest at the top

2025-04-01 13:46:48 +0200fp(~Thunderbi@2001:708:150:10::1d80) (Ping timeout: 272 seconds)
2025-04-01 13:46:13 +0200tromp(~textual@2001:1c00:3487:1b00:29bc:7fae:9d9f:d545) (Quit: My iMac has gone to sleep. ZZZzzz…)
2025-04-01 13:45:58 +0200__monty__(~toonn@user/toonn) toonn
2025-04-01 13:44:21 +0200merijn(~merijn@77.242.116.146) merijn
2025-04-01 13:41:09 +0200merijn(~merijn@77.242.116.146) (Ping timeout: 248 seconds)
2025-04-01 13:35:41 +0200tromp(~textual@2001:1c00:3487:1b00:29bc:7fae:9d9f:d545)
2025-04-01 13:31:12 +0200 <Leary> Indeed.
2025-04-01 13:29:36 +0200 <kqr> I guess that is a vote in favour of Alternative?
2025-04-01 13:24:39 +0200 <lambdabot> (["","a"],[Nothing,Just 'a'])
2025-04-01 13:24:37 +0200 <Leary> > let test = [guard False $> 'a', guard True $> 'a'] in (test :: [String], test :: [Maybe Char])
2025-04-01 13:21:03 +0200toby-bro(~toby-bro@user/toby-bro) toby-bro
2025-04-01 13:20:24 +0200 <Leary> Well, generalising, yeah. I was thinking about `instance Semigroup a => Monoid (Maybe a)`.
2025-04-01 13:19:48 +0200 <merijn> In fact, it's like, their main distinguishing feature :p
2025-04-01 13:19:40 +0200 <merijn> Semigroups (pretty notably) do not have mempty
2025-04-01 13:19:29 +0200 <merijn> Leary: You mean Monoid
2025-04-01 13:18:53 +0200xff0x(~xff0x@2405:6580:b080:900:974d:9d72:56de:9211)
2025-04-01 13:18:34 +0200 <Leary> kqr: `mempty` would impose an unwanted `Semigroup` constraint. Also, I suspect you really want `guard`.
2025-04-01 13:18:19 +0200 <kqr> Notably, this function only uses pure and empty, it never uses operators <|> or <>
2025-04-01 13:17:33 +0200 <kqr> I guess another way to phrase the question would be "When a result is interpreted either as a Maybe a or [a], is Monoid or Alternative the most intuitive generalisation?"
2025-04-01 13:16:53 +0200 <kqr> This is in a module-private function that is called by two other exported functions, one of which specialise it to Maybe a, and the other to [a]
2025-04-01 13:16:18 +0200 <merijn> otoh, if the type is fixed to be Maybe, why not just write Nothing for readability
2025-04-01 13:16:03 +0200 <merijn> kqr: If the type is fixed to be Maybe there is not distinction
2025-04-01 13:15:08 +0200tromp(~textual@2001:1c00:3487:1b00:29bc:7fae:9d9f:d545) (Quit: My iMac has gone to sleep. ZZZzzz…)
2025-04-01 13:09:16 +0200 <kqr> I could, of course, also return a plain `Nothing` but in this case I want the function to be generic over both Maybe values and lists.
2025-04-01 13:08:58 +0200 <kqr> If I have a function returning a Maybe of something, and I want to return a Nothing, I can return `mempty` but I can also return `empty`. I have a rough intuition that `mempty` is more appropriate for things that are supposed to be aggregated together, whereas `empty` is more appropriate for things that are supposed to be used a choices. But how would I know which to use?
2025-04-01 13:06:01 +0200Smiles(uid551636@id-551636.lymington.irccloud.com) (Quit: Connection closed for inactivity)
2025-04-01 13:05:01 +0200merijn(~merijn@77.242.116.146) merijn
2025-04-01 13:02:20 +0200caconym(~caconym@user/caconym) caconym
2025-04-01 13:00:05 +0200caconym(~caconym@user/caconym) (Quit: bye)
2025-04-01 12:59:06 +0200merijn(~merijn@77.242.116.146) (Ping timeout: 265 seconds)
2025-04-01 12:58:48 +0200internatetional(~nate@2400:9800:170:c23:1:0:419:21ae) (Quit: CoreIRC for Android - www.coreirc.com)
2025-04-01 12:54:50 +0200ash3en(~Thunderbi@149.222.150.125) ash3en
2025-04-01 12:54:09 +0200acidjnk_new(~acidjnk@p200300d6e71c4f8289e7d3d4c6144767.dip0.t-ipconnect.de)
2025-04-01 12:53:56 +0200jathan(~jathan@69.61.93.38) jathan
2025-04-01 12:53:50 +0200unter-oe(~unter-oe@user/unter-oe) (Remote host closed the connection)
2025-04-01 12:52:05 +0200acidjnk_new(~acidjnk@p200300d6e71c4f8289e7d3d4c6144767.dip0.t-ipconnect.de) (Ping timeout: 248 seconds)
2025-04-01 12:51:06 +0200sord937(~sord937@gateway/tor-sasl/sord937) sord937
2025-04-01 12:50:46 +0200sord937(~sord937@gateway/tor-sasl/sord937) (Remote host closed the connection)
2025-04-01 12:48:00 +0200merijn(~merijn@77.242.116.146) merijn
2025-04-01 12:42:17 +0200lisbeths(uid135845@id-135845.lymington.irccloud.com) (Quit: Connection closed for inactivity)
2025-04-01 12:35:09 +0200merijn(~merijn@77.242.116.146) (Ping timeout: 244 seconds)
2025-04-01 12:31:24 +0200unter-oe(~unter-oe@user/unter-oe) unter-oe
2025-04-01 12:30:46 +0200merijn(~merijn@77.242.116.146) merijn
2025-04-01 12:29:10 +0200unter-oe(~unter-oe@user/unter-oe) (Remote host closed the connection)
2025-04-01 12:27:33 +0200unter-oe(~unter-oe@user/unter-oe) unter-oe
2025-04-01 12:27:33 +0200unter-oe(~unter-oe@176.192.243.31) (Changing host)
2025-04-01 12:27:33 +0200unter-oe(~unter-oe@176.192.243.31)
2025-04-01 12:27:12 +0200unter-oe(~unter-oe@user/unter-oe) (Remote host closed the connection)
2025-04-01 12:26:32 +0200fp(~Thunderbi@2001:708:150:10::1d80) fp
2025-04-01 12:26:22 +0200xff0x(~xff0x@fsb6a9491c.tkyc517.ap.nuro.jp) (Ping timeout: 244 seconds)