[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: the forward method [dynamic vs. static typing]

On 2003-12-10T11:46:38-0500, Felix Klock's ll1 list proxy wrote:
> Example: define the type Answer to be a *product* of [Maybe Double] and 
> [Maybe Bool] (product, not sum; in other words, use records, not 
> unions).    [Maybe X] is the tagged sum of (Just X) and Nothing.

Let me just note that the Haskell type class system gives you an
infinite, type-directed family of read functions.  If you know how to
read a Double, you also know how to read a [Double] (i.e., a Double
list), and [[Double]], and so on.  And you can custom-define a data type

    data SuperList a = SuperList a (SuperList [a])

whose reading potentially involves all of this infinite family of
list-reading functions.  This infinity distinguishes Haskell type
classes from, say, C++ templates.

Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig
International Human Rights Day * 2003-12-10 * http://www.un.org/rights/

What if All Chemists Went on Strike? (science fiction)

Attachment: signature.asc
Description: Digital signature