[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: another take on hackers and painters
Jakub Travnik <J.Travnik@sh.cvut.cz> wrote:
>Very nice example of static typing! ;-)
>
>See, there is an error. The error is in the type information
>_only_. If you did not write type information, all would be correct
>(I know that in this case this is not needed in Haskell). Of course,
>compiler will catch the error, but in the language with dynamic typing
>there could be no such error.
Of course, in the language with dynamic typing, you could also write:
qsort [] = []
qsort (x : xs) = qsort [ y | y <- xs, y <= x ]
++ x ++ qsort [ y | y <- xs, y > x ]
which would work fine. For a while. (Depending on the definition of
++, <=, and >, it might actually work for quite a while.)
Tommy "got bit by a relative of this one Monday" McGuire