"its ust that putting typesignatures in comments and checking them when i write new functions has done me fine in Ruby"
if you are writing type signatures anyway why not also have (a language in which) the compiler enforces them?
I understand using a dynamic typed languages and not having to write type signatures. I understand using a static typed language and having to write type signatures (or having the compiler infer them) and having the compiler ensure type safety.
Your approach (writing type signatures in comments and manually type checking them) seems to combine the worst of both worlds? I don't imagine many people can do type checking/inference in their heads for large code bases.
Not snark. Genuinely curious as to why someone would do something like this.
When I've tried to explain Haskell to Ruby folks, I mention that at some point you are likely to be writing unit tests that amount to type checks. Maybe not always, or maybe not explicitly, but the value/effort ratio of writing a type signature in Haskell is at least as good as the corresponding test code you would write in Ruby. And you don't even have to write the type signature all the time, but you still get the type checking benefits.
As a Ruby folk, I somewhat agree. Unit testing is essential in a dynamic language otherwise things are going to blow up.
However, this doesn't really blow up the number of test cases. If you're unit testing dynamically typed languages versus unit testing statically types languages, there is negligible number of test cases that would exist in Ruby for the purposes of type checking (over said statically typed language; there are type checking cases for when you're switching on type, obviously).
In fact, I find that writing tests in a dynamic language becomes easier over time because of the abstractions that are easier to generate in dynamically typed languages. Some of those abstractions may be possible in statically type languages, but it's significantly more difficult.
Disclaimer: I've never written tests (only 'toy' code) in Haskell.
"However, this doesn't really blow up the number of test cases."
Sure. But what I tell non-static-typing people is that the effort to write the type sig is arguably less than any unit test you might write, and the typing eliminates at least some likely tests you might otherwise have to write.
Now, Haskell's type system introduces other concerns, and I haven't written enough to say how, overall, that compares to developing in Ruby.
", I find that writing tests in a dynamic language becomes easier over time because of the abstractions that are easier to generate in dynamically typed languages. Some of those abstractions may be possible in statically type languages, but it's significantly more difficult."
I ported some Haskell code to Ruby and found that there were a number of powerful high-level abstractions in Haskell that were damn hard for me to replicate in Ruby.
It may be an apples-to-oranges comparison, plus I need more Haskell experience to get a better feel for things, but so far I don't see Haskell as being in any way less capable in generating abstractions.
The issue may be that the two languages just offer different realms of abstractions, and trying to do Ruby-style abstractions in Haskell is as prone to pain as Haskell-style abstractions in Ruby.