Re:Fun with Dependent Types in Haskell
by skybrian on Monday October 13, 2014 @09:59PM
(#8451576)
Yes, you still have to validate your input. The question is how far downstream code can rely on validation already being done versus having to check it again. It's simple enough to write a new class that enforces an invariant, but if you have to invent a new type for every invariant you'll have lots of one-off types. Hence the complicated type machinery.
[ Parent
| on HN ]
Re:Fun with Dependent Types in Haskell
by dkarapetyan on Monday October 13, 2014 @10:15PM
(#8451629)
Right. I'm not saying there is no advantage to putting the machinery in place so that chunks of size 9, 10, 11, etc. are easier to express in the type system. The problem I have with this is that there is a bit of dependent type theory envy going on and if you watch the talk linked in the article the required boilerplate is non-trivial.