2025/02/12

Newest at the top

2025-02-12 20:30:40 +0100 <c_wraith> but w isn't going to be around
2025-02-12 20:30:17 +0100 <c_wraith> You can catch in that type
2025-02-12 20:30:09 +0100 <lambdabot> IO (a, w)
2025-02-12 20:30:09 +0100 <c_wraith> @unmtl WriterT w IO a
2025-02-12 20:28:49 +0100 <hololeap> (I'll probably end up using Reader+IORef, but I'm curious if this is possible)
2025-02-12 20:28:07 +0100 <hololeap> it's in a loop using `execWriterT $ forM_ ...`
2025-02-12 20:27:22 +0100 <hololeap> with `WriterT w IO`, is it possible to catch ctrl+c and dump the `w` stdout before aborting, or do I require `ReaderT (IORef w) IO`
2025-02-12 20:24:48 +0100zungi(~tory@user/andrewchawk) andrewchawk
2025-02-12 20:24:27 +0100zungi(~tory@user/andrewchawk) (Remote host closed the connection)
2025-02-12 20:24:04 +0100alfiee(~alfiee@user/alfiee) (Ping timeout: 260 seconds)
2025-02-12 20:24:00 +0100ft(~ft@p4fc2a610.dip0.t-ipconnect.de) ft
2025-02-12 20:19:23 +0100alfiee(~alfiee@user/alfiee) alfiee
2025-02-12 20:15:58 +0100jespada(~jespada@2800:a4:22f4:ae00:fc16:e598:5958:94e6) jespada
2025-02-12 20:13:55 +0100 <monochrom> :)
2025-02-12 20:13:26 +0100 <mauke> I figured there would be some kind of diagonalization involved
2025-02-12 20:10:10 +0100 <monochrom> But I have proved that the infinite stream monad is unique (and its <*> does zipping). join xss = [xss !! n !! n | n <- [0..]]
2025-02-12 20:08:27 +0100ash3en(~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) (Quit: ash3en)
2025-02-12 20:06:07 +0100 <monochrom> Yes, moreover you have to ban all finite lists.
2025-02-12 20:05:57 +0100 <lambdabot> ZipList {getZipList = [42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42...
2025-02-12 20:05:56 +0100 <mauke> > pure 42 :: ZipList Int
2025-02-12 20:05:48 +0100 <geekosaur> iirc ZipList would require `return` to produce an infinite list?
2025-02-12 20:05:41 +0100 <monochrom> But I came close to seeing why ZipList cannot be a monad.
2025-02-12 20:03:51 +0100 <monochrom> I don't actually know of one. I made a bet. :)
2025-02-12 20:01:55 +0100 <mauke> is there a simple proof that Monad [] is unique?
2025-02-12 20:00:48 +0100 <lambdabot> ZipList {getZipList = [10,21]}
2025-02-12 20:00:47 +0100 <monochrom> > pure (+) <*> ZipList [0,1] <*> ZipList [10,20]
2025-02-12 20:00:20 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2025-02-12 20:00:12 +0100 <monochrom> But the stdlib knows your wish! It has the newtype wrapper ZipList that will do zipping for <*>.
2025-02-12 19:59:22 +0100 <monochrom> That in turn is because we would like <*> to be consistent with >>= whenever applicable. List's >>= has to do cartesian product, there is no other List monad.
2025-02-12 19:59:02 +0100 <mauke> <*> on [] is defined this way to remain compatible with the Monad [] instance
2025-02-12 19:58:28 +0100 <monochrom> List's <*> does cartesian product rather than zipping.
2025-02-12 19:58:19 +0100 <mauke> because of how <*> is defined on []
2025-02-12 19:57:40 +0100 <energizer> why does `pure (+) <*> [0,1] <*> [10,20]` produce [10,20,11,21] and not zipWith?
2025-02-12 19:56:20 +0100remedan(~remedan@ip-62-245-108-153.bb.vodafone.cz) (Quit: Bye!)
2025-02-12 19:53:01 +0100vanishingideal(~vanishing@user/vanishingideal) vanishingideal
2025-02-12 19:51:14 +0100vanishingideal(~vanishing@user/vanishingideal) (Ping timeout: 252 seconds)
2025-02-12 19:46:37 +0100 <hololeap> fair point
2025-02-12 19:44:52 +0100 <haskellbridge> <sm> sometimes seeing code helps
2025-02-12 19:44:30 +0100fun-safe-math(~fun-safe-@2601:1c2:1b7f:801f:c74b:f0dc:f04d:3261) fun-safe-math
2025-02-12 19:44:17 +0100 <hololeap> no worries. I can just use a regex that people provided on stack exchange, and then I don't have to pull in hledger :)
2025-02-12 19:44:12 +0100Unicorn_Princess(~Unicorn_P@user/Unicorn-Princess/x-3540542) (Remote host closed the connection)
2025-02-12 19:43:26 +0100[tank](sid630849@id-630849.tinside.irccloud.com)
2025-02-12 19:43:25 +0100 <haskellbridge> <sm> :)
2025-02-12 19:43:15 +0100fun-safe-math(~fun-safe-@2601:1c2:1b7f:801f:f530:2eec:1f02:adc2) (Quit: No Ping reply in 180 seconds.)
2025-02-12 19:42:55 +0100 <haskellbridge> <sm> I'm sorry
2025-02-12 19:42:42 +0100 <hololeap> sm: eh, it's just using a regex and not a very good one. but thanks
2025-02-12 19:42:17 +0100Lord_of_Life_Lord_of_Life
2025-02-12 19:41:47 +0100 <haskellbridge> <sm> hololeap: String ? https://hackage.haskell.org/package/hledger-lib-1.41/docs/Hledger-Utils-String.html#v:stripAnsi
2025-02-12 19:40:56 +0100Lord_of_Life_(~Lord@user/lord-of-life/x-2819915) Lord_of_Life
2025-02-12 19:40:50 +0100Lord_of_Life(~Lord@user/lord-of-life/x-2819915) (Ping timeout: 248 seconds)