logoalt Hacker News

Etherytetoday at 4:02 PM7 repliesview on HN

I don't know, as far as I can tell the demo on the homepage is bugged? Or maybe I misunderstand how it's supposed to work? If I click reset after 2 seconds and then click add 1 right after it, the reset never fires. What's up with that, that's not what I expected to happen?


Replies

speedgoosetoday at 4:47 PM

I guess it comes from the `tagsExhaustive` keyword. But I tried to search what it does in the documentation, and it doesn't return any hit. I then searched in the git repository and found it in some examples and CLAUDE.md but it doesn't really seem straightforward.

Perhaps it makes sense for AI agents, but as a human, I will pass.

show 1 reply
danfritztoday at 4:12 PM

Yep, it seems that if you hammer messages things get easily dropped or the async behavior is not executed.

IMO the reset should fire regardless what happens after it.

airstriketoday at 4:40 PM

Yeah, I can see how some scenarios might want that behavior, but it sort of defeats the purpose of the demo. It wouldn't hurt to have the reset be cancelable too if you wanted to really showcase how it should work

horsawlarwaytoday at 6:56 PM

Agreed - I hit "Reset after 2 seconds", I hit "Add 1", and sure - it adds one, but it also unexpectedly cancels the reset.

Which I don't expect from the description, and I also don't expect from the code.

---

So outside of the simple "This is broken..." feedback, I want to further pick on this example:

Don't fucking hide the imports.

Especially don't fucking hide the imports if you're showing example code, and you're doing things like

```

import { Match as M, Schema as S } from 'effect'

import { m } from 'foldkit/message'

```

Which I only know because I bothered to dig through the example playground counter (which is a different example entirely!)

It's a huge issue to show demo code where concepts magically appear, and it's just bad manners to use shorthand at the same time.

show 1 reply
devinjamesontoday at 8:55 PM

Will take a look at this tonight thanks for the feedback.

PaulHouletoday at 8:05 PM

The code didn't look that clear to me. Like bad smell city.

ivanjermakovtoday at 7:27 PM

It's a framework for correctness, after all :)