NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
static typing (Score:1)
Static typing without type inference
If you're going to make a new language, please make a type-inferring version of C. kthxbye
Re:static typing (Score:2)
Re:static typing (Score:2)
sqis defined for all valuesa, such thatais an instance of the type classNum. Remember, Haskell is strongly typed, and this function is defined on all kinds of numbers (machine integers, bignums, floats, doubles, complex, etc.). Furthermore, it will be defined on all types you define that are also instances ofNum.This is a contrived example, but it does demonstrate type inference. That is, it avoids the Java problem where a function like
sqneeds to be redefined for every numeric type you want to square (primitive numbers and user defined numeric types). All with a single definition.Reply to This
Parent