(Note: I have only read a bunch about Haskell. I am by no means an expert)
In my hobby work with Python, I absolutely have no choice but to read the documentation for a function to know what it does. The dynamic typing necessitates that the function itself tells me nothing. Consider:
def get_console_type(console)
Does this function take a console object? The string name of the console? The IPAddress of it?
In my professional work with C# (well, in this case C), the type signature tells me quite a bit more information.
ConsoleType GetConsoleType(IXboxConsole*)
One step further: does GetConsoleType have any side effects? It shouldn't by naming convention. But it turns out it did. It updates a cache, which can have a major effect on some totally unrelated thing.
Haskell, being a pure language, has to declare the presence of side effects. I'd have know this right away, without having to look at any documentation (there isn't any!). Furthermore, what if the function wasn't actually called GetConsoleType. What if it was called GetXboxType?
I really wished I could have searched for "All functions that return ConsoleType"...
In my hobby work with Python, I absolutely have no choice but to read the documentation for a function to know what it does. The dynamic typing necessitates that the function itself tells me nothing. Consider:
def get_console_type(console)
Does this function take a console object? The string name of the console? The IPAddress of it?
In my professional work with C# (well, in this case C), the type signature tells me quite a bit more information.
ConsoleType GetConsoleType(IXboxConsole*)
One step further: does GetConsoleType have any side effects? It shouldn't by naming convention. But it turns out it did. It updates a cache, which can have a major effect on some totally unrelated thing.
Haskell, being a pure language, has to declare the presence of side effects. I'd have know this right away, without having to look at any documentation (there isn't any!). Furthermore, what if the function wasn't actually called GetConsoleType. What if it was called GetXboxType?
I really wished I could have searched for "All functions that return ConsoleType"...