News for hackers. Stuff that matters.
Re:Popularizing Haskell through easy web deployment by gnuvince on Saturday December 07, 2013 @08:48AM (#6866351)
Nothing can prevent a undocumented mess, but certain factors can help mitigate it. For example, most people in Haskell write the type declarations for their top-level functions, which certainly helps. Also, because you need to be honest about side effects in Haskell, if you see Vector a -> Int -> a, you know there are no side effects and so you can be pretty damn sure that this is an indexing function.
Re:Popularizing Haskell through easy web deployment by ocharles on Saturday December 07, 2013 @10:41AM (#6866619)
Not just is that function pure, but free theorems indicate that the only way you can get an a is by using the Vector that goes in. Sure, it could ignore the Int - we don't have linear types, afterall - but it really does narrow down the "what could this do?" options.
Re:Popularizing Haskell through easy web deployment by gnuvince on Saturday December 07, 2013 @01:15PM (#6867088)
For those interested, ocharles is talking about Theorems for Free![1] by Phil Wadler. Also be sure to check out his 24 Days of Hackage 2013.

[1] http://ttic.uchicago.edu/~dreyer/course/papers/wadler.pdf [2] http://ocharles.org.uk/blog/pages/2013-12-01-24-days-of-hack...