2025/01/12

Newest at the top

2025-01-12 01:52:40 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds)
2025-01-12 01:48:09 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) merijn
2025-01-12 01:46:23 +0100 <haskellbridge> <Bowuigi> c_wraith re:catamorphism https://www.haskellforall.com/2021/01/the-visitor-pattern-is-essentially-same.html this is relevant I guess
2025-01-12 01:37:40 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 260 seconds)
2025-01-12 01:33:09 +0100 <c_wraith> that's less common in java, but not absent. (Same root cause...)
2025-01-12 01:32:47 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) merijn
2025-01-12 01:32:02 +0100 <c_wraith> It tries to be "friendly" instead of "type safe"
2025-01-12 01:31:45 +0100 <c_wraith> Lots of python code commits crimes against parametricity
2025-01-12 01:30:52 +0100 <monochrom> haha
2025-01-12 01:30:42 +0100 <c_wraith> crimes against parametricity
2025-01-12 01:29:17 +0100 <monochrom> But the whole point of Python and Java is if you write "instanceof" you're commiting a crime.
2025-01-12 01:28:35 +0100 <monochrom> For mere mortals, the composite pattern would be good enough and pretty easy to understand actually.
2025-01-12 01:28:23 +0100 <c_wraith> Huh. I guess the visitor pattern is sort of a catamorphism that uses algebras encoded as an object.
2025-01-12 01:27:55 +0100 <monochrom> I would be very impressed if they used the visitor pattern.
2025-01-12 01:27:23 +0100 <c_wraith> so... they should have used the visitor pattern.
2025-01-12 01:27:01 +0100 <monochrom> But the student was too excited by Haskell, so they went overboard and translate Haskell pattern matching to Python. "if instanceof(e, Or) ... elif instanceof(e, And) .. elif ..."
2025-01-12 01:26:48 +0100 <c_wraith> the python should be using the visitor pattern. :P
2025-01-12 01:26:23 +0100 <c_wraith> but then you've turned the expression problem sideways!
2025-01-12 01:26:07 +0100dtman34(~dtman34@2601:447:d080:1a3c:198e:8888:ba04:6650) dtman34
2025-01-12 01:26:02 +0100 <monochrom> Clearly, in Python you would not make an algebraic type, you would make a Not class, And class, Or class; and the evaluation function would be a common method.
2025-01-12 01:24:55 +0100 <monochrom> In that student's case, the assignment was to first use algebraic data types in Haskell to define a type for boolean expressions and functions for evaluations. Then the next question is "how would you code this up in Python?"
2025-01-12 01:23:14 +0100 <monochrom> I had a student who tried to write Haskell in Python. I gave them a very low mark. If you use Python, you play to the strength of Python. If you use Haskell, you play to the strength of Haskell.
2025-01-12 01:22:28 +0100 <monochrom> Clearly, design patterns and anti-patterns depend on the language.
2025-01-12 01:21:45 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 246 seconds)
2025-01-12 01:17:14 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) merijn
2025-01-12 01:12:18 +0100notzmv(~umar@user/notzmv) notzmv
2025-01-12 01:11:12 +0100notzmv(~umar@user/notzmv) (Ping timeout: 265 seconds)
2025-01-12 01:08:48 +0100dtman34(~dtman34@2601:447:d080:1a3c:198e:8888:ba04:6650) (Ping timeout: 246 seconds)
2025-01-12 01:07:00 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 276 seconds)
2025-01-12 01:03:23 +0100dtman34(~dtman34@2601:447:d080:1a3c:198e:8888:ba04:6650) dtman34
2025-01-12 01:01:52 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) merijn
2025-01-12 01:01:32 +0100dtman34(~dtman34@c-174-53-203-90.hsd1.mn.comcast.net) (Ping timeout: 265 seconds)
2025-01-12 00:57:44 +0100Garbanzo(~Garbanzo@2602:304:6eac:dc10::46)
2025-01-12 00:56:33 +0100mreh(~matthew@host86-146-25-121.range86-146.btcentralplus.com) (Ping timeout: 246 seconds)
2025-01-12 00:56:30 +0100tomku(~tomku@user/tomku) tomku
2025-01-12 00:54:36 +0100dtman34(~dtman34@c-174-53-203-90.hsd1.mn.comcast.net) dtman34
2025-01-12 00:51:03 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds)
2025-01-12 00:49:44 +0100hiredman(~hiredman@frontier1.downey.family) hiredman
2025-01-12 00:46:28 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) merijn
2025-01-12 00:37:59 +0100machinedgod(~machinedg@d108-173-18-100.abhsia.telus.net) (Ping timeout: 260 seconds)
2025-01-12 00:35:40 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds)
2025-01-12 00:31:06 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) merijn
2025-01-12 00:31:05 +0100hiredman(~hiredman@frontier1.downey.family) (Quit: Lost terminal)
2025-01-12 00:29:52 +0100wootehfoot(~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer)
2025-01-12 00:28:33 +0100dtman34(~dtman34@c-174-53-203-90.hsd1.mn.comcast.net) (Ping timeout: 246 seconds)
2025-01-12 00:20:09 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 246 seconds)
2025-01-12 00:17:06 +0100troydm(~troydm@user/troydm) troydm
2025-01-12 00:16:41 +0100mhatta(~mhatta@www21123ui.sakura.ne.jp)
2025-01-12 00:15:42 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) merijn
2025-01-12 00:13:54 +0100mhatta(~mhatta@www21123ui.sakura.ne.jp) (Quit: ZNC 1.9.1+deb2+b1 - https://znc.in)