
Super. This is really a great mailing list :)
-----Original Message-----
From: haskell-cafe-bounces@haskell.org
[mailto:haskell-cafe-bounces@haskell.org] On Behalf Of Chung-chieh Shan
Sent: Friday, July 13, 2007 16:54
To: haskell-cafe@haskell.org
Subject: [Haskell-cafe] Re: Newbie question about tuples
peterv
I don't think Haskell has something like a "fixed-length array" or constant expressions that *must* be resolved at compile-time (like the N in the C++ template)? Or like Digital Mars D's "static if" statement (which is a control-flow statement that *must* succeed at compile time)?
Actually, Haskell can do it one better: you can have fixed-length arrays whose length is known only at run time. That is, you can have the compiler check that you will only be adding arrays with the same length, but find out what that length is (and pass it around non-redundantly) at run time. (You can encode the same idea, more verbosely, using generics in Java and C#.) Please see (among other work): http://ofb.net/~frederik/vectro/ http://www.cs.rutgers.edu/~ccshan/prepose/ http://www.eecs.usma.edu/webs/people/okasaki/icfp99.ps -- Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig http://www.unaids.org/en/HIV_data/epi2006/ UNAIDS/WHO AIDS Epidemic Update: December 2006 _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.4/898 - Release Date: 12/07/2007 16:08 No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.4/898 - Release Date: 12/07/2007 16:08