in reply to The power of strict typo-checking

This drawback is not part of the general tradeoff that comes with type checking but rather is an artifact of certain implementations. For example, Haskell's type system supportsThe drawback is that operators have to be distinct by type: for example, "+." is used for floating-point addition and "+" for integer addition.

*type classes*and does away with this limitation:

$ ghci ___ ___ _ / _ \ /\ /\/ __(_) / /_\// /_/ / / | | GHC Interactive, version 6.2.1, for Haskell 98. / /_\\/ __ / /___| | http://www.haskell.org/ghc/ \____/\/ /_/\____/|_| Type :? for help. Loading package base ... linking ... done. Prelude> :t (+) (+) :: forall a. (Num a) => a -> a -> a Prelude> 1 + 1 2 Prelude> 1.0 + 1.0 2.0 Prelude> :module +Ratio Prelude Ratio> 1%2 + 1%3 5 % 6

Cheers,

Tom

**Tom Moertel** : Blog / Talks / CPAN / LectroTest / PXSL / Coffee / Movie Rating Decoder

In Section
Meditations

Comment onRe: The power of strict typo-checkingDownloadCode