Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I thought that was the point of the section- that you may be able to tell something is wrong with the example, but the compiler can't. Thus by programming in that fashion you're not taking advantage of the power of the compiler.

The improved way below where the Just a is unwrapped with a case allows the compiler to see whether or not x is valid.



Ah ok, that wasn't really clear to me, but that makes way more sense. Clearly I hadn't had any coffee when I read it earlier.


That's what these parts were going for:

> Is there anything wrong with the definitions and below

> and why is this not caught in the type system?

And

> ???

on the line you flagged as a bug.




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

Search: