2026/06/28

Newest at the top

2026-06-28 23:21:34 +0000 <monochrom> Breaks join . pure = id
2026-06-28 23:20:21 +0000 <EvanR> use platonic / morally correct / vibes haskell
2026-06-28 23:20:05 +0000 <EvanR> that's fine
2026-06-28 23:19:57 +0000 <schuelermine> which is annoying
2026-06-28 23:19:50 +0000 <schuelermine> join isn’t in Monad so you can’t define join and have bind automatically work
2026-06-28 23:19:22 +0000 <EvanR> join ((a,b),(x,y)) = (b,x) ought to also work?
2026-06-28 23:18:51 +0000tremon(~tremon@83-80-159-219.cable.dynamic.v4.ziggo.nl) (Quit: getting boxed in)
2026-06-28 23:15:00 +0000 <schuelermine> courtesy of pointfree.io
2026-06-28 23:14:54 +0000vanishingideal(~vanishing@user/vanishingideal) (Ping timeout: 245 seconds)
2026-06-28 23:13:38 +0000 <monochrom> join bimap. That's an awesome move.
2026-06-28 23:13:14 +0000 <monochrom> haha
2026-06-28 23:13:03 +0000 <schuelermine> I just love abusing ViewPatterns for nonsense like this
2026-06-28 23:12:51 +0000 <schuelermine> yeah
2026-06-28 23:12:41 +0000 <monochrom> I think join is easier to work with in this case.
2026-06-28 23:12:25 +0000 <schuelermine> (Two a) >>= (($ a) . join bimap -> (Two (x, _), Two (_, y))) = Two (x, y)
2026-06-28 23:12:23 +0000 <schuelermine> well, the definition of bind
2026-06-28 23:12:09 +0000 <schuelermine> I have written this definition of join in a truly cursed fashion
2026-06-28 23:10:42 +0000divlamir(~divlamir@user/divlamir) divlamir
2026-06-28 23:08:32 +0000 <monochrom> So if you try for example (a,x) you will run into a problem.
2026-06-28 23:07:57 +0000 <monochrom> I worked for an hour to prove it. Then, like someone just said, I heard "it's just Bool->a" and I was like I'm a moron why did I waste an hour. :)
2026-06-28 23:07:31 +0000 <schuelermine> monochrom: honestly not really sure how another definition of join would fail the monad laws but I haven’t checked yet
2026-06-28 23:06:56 +0000 <monochrom> schuelermine: You've got it right. In fact, the only way to please the monad laws. :)
2026-06-28 23:05:33 +0000divlamir_(~divlamir@user/divlamir) (Ping timeout: 252 seconds)
2026-06-28 23:04:33 +0000divlamir(~divlamir@user/divlamir) (Ping timeout: 265 seconds)
2026-06-28 23:00:28 +0000divlamir_(~divlamir@user/divlamir) divlamir
2026-06-28 22:58:21 +0000 <schuelermine> true but I’m not gonna bother just to prove to you this isn’t a homework question lmao
2026-06-28 22:58:00 +0000 <EvanR> I think this one might not be that bad
2026-06-28 22:57:50 +0000 <schuelermine> yes; annoyingly long equations
2026-06-28 22:57:42 +0000 <EvanR> commutative diagrams are shorthand for equations
2026-06-28 22:57:26 +0000 <schuelermine> can’t really share that here
2026-06-28 22:57:16 +0000 <schuelermine> well I drew the commutative diagrams on paper
2026-06-28 22:57:08 +0000 <EvanR> equation theories lend themselves to equational reasoning
2026-06-28 22:56:26 +0000 <EvanR> now that you think you know show the work xD
2026-06-28 22:55:36 +0000 <schuelermine> EvanR: I just thought of this and I tried working it out. I was pretty sure it is a monad but like not 100% sure
2026-06-28 22:55:04 +0000 <schuelermine> shachaf: that makes sense
2026-06-28 22:54:50 +0000 <schuelermine> EvanR: no
2026-06-28 22:54:36 +0000 <shachaf> schuelermine: Yes. Maybe more commonly seen by the name (Bool ->).
2026-06-28 22:53:57 +0000 <EvanR> (alternatively, the IO action samples from a brouwerian lawless sequence)
2026-06-28 22:53:13 +0000 <EvanR> though this is a separate subject from my harry potter analogy, where you don't know the provenance of the IO action
2026-06-28 22:52:46 +0000 <EvanR> what if the result of an IO operation depends on a high energy particle physics experiment for which we have no good theories yet, hypothetically
2026-06-28 22:51:59 +0000 <jreicher> monochrom: that sounds like the result of an IO operation is magic? But not necessarily the operation itself? ("Read from keyboard" is straightforward; but what ends up being read cannot be explained)
2026-06-28 22:51:15 +0000peterbecich(~Thunderbi@71.84.33.135) (Ping timeout: 252 seconds)
2026-06-28 22:49:31 +0000mikess(~sam@S010664777dafd303.cg.shawcable.net)
2026-06-28 22:49:18 +0000divlamir(~divlamir@user/divlamir) divlamir
2026-06-28 22:46:23 +0000 <EvanR> is this a homework problem
2026-06-28 22:45:41 +0000 <schuelermine> is `newtype Two a = (a, a)` a monad with `join ((a, b), (x, y)) = (a, y)`? (that is are the monad laws fulfilled)
2026-06-28 22:44:45 +0000schuelermine(~Thunderbi@user/schuelermine) schuelermine
2026-06-28 22:40:37 +0000peterbecich(~Thunderbi@71.84.33.135) peterbecich
2026-06-28 22:39:55 +0000divlamir(~divlamir@user/divlamir) (Ping timeout: 264 seconds)
2026-06-28 22:39:42 +0000peterbecich(~Thunderbi@71.84.33.135) (Ping timeout: 252 seconds)