|
|
|
|
|
by stonemetal
5108 days ago
|
|
In some way yes, but in general not really. (+),(-), (*) all have the type (Num a) a -> a -> a abs, signum both have the type (Num a) a-> a In the first case it works as documentation because I already know what they do. In the second case I read signum as sig num instead of sign num, and was left scratching my head as to what a signature number was, until I read the actual documentation. So I would say types make a good reference documentation but not a good learning documentation. Contrast this with python doc strings which can be both a good reference and a decent source of learning. |
|