Skip to content

Comment on Hazel: A live functional programming environment featuring typed holesparent

Comments

Congrats, this seems fun and neat!

But small question related to https://hazel.org/build/dev/, given

Non-empty holes are the red boxes around type errors

... why is the case statement in the list example red-boxed?

If you put the cursor on it you'll see an error message at the bottom. In this case the case expression is inexhaustive because it's only handling lists of size 0, 1, and 2.

(Haven’t worked with hazel and I couldn’t find much in the documentation so this may be wrong)

Because that case is non-exhaustive. It will match a list with 0, 1, or 2 elements, but the last arm matches a list with exactly 2 elements, not 2 or more, so as soon as you get to 3 or more elements, there’s no code to execute.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.