Hacker News new | past | comments | ask | show | jobs | submit | cjstadler's comments login

What does it mean for a type class to be "law-abiding"? I'm coming from Rust so I'm curious what the "issue" is with FromIterator.


I don’t know if there is an “issue” with fromIterator, the comment is just that it is ad-hoc: there is no law for it to satisfy.

Law-abiding means that some equation holds, for example a monoid instance should be associative, so ((a <> b) <> c) should always produce the same result as (a <> (b <> c)). There is nothing checking that my implementation of <> abides by this law, but other programmers (and optimisers or compilers, maybe?) can make use of it, and might write incorrect code if my instance does not abide by the law.

Another example would be functors: it should be the case that (fmap f) . (fmap g) is the same as fmap (f . g), for all functions f and g that make sense in the equation (output type of g must match input type of f).


Are you on Firefox? This resolved it for me: https://support.mozilla.org/en-US/kb/twitter-isnt-working-fi...


Yes but mobile.


Firefox showed me an ad (or whatever you want to call it) for common voice yesterday, so I would guess that's why it's suddenly being posted a lot.


I guess that also explains why all their "help us get to X" have been achieved several times over. Hopefully most of those contributions are actually by serious participants and not just a bunch of trolls trying to poison the database.


Cool presentation.

This reminded me of Hannah Gadsby's "Nanette" because, like Ali Wong's show, it has a strong narrative arc, and because, like this presentation itself, it analyzes the structure of comedy.


It reminded me of that too, especially since Nanette goes in-depth about how tension and release are tapped into to shape humour.


Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: