[Haskell-cafe] Re: Newbie question about tuples

peterv bf3 at telenet.be
Fri Jul 13 11:17:01 EDT 2007


Super. This is really a great mailing list :)

-----Original Message-----
From: haskell-cafe-bounces at haskell.org
[mailto:haskell-cafe-bounces at haskell.org] On Behalf Of Chung-chieh Shan
Sent: Friday, July 13, 2007 16:54
To: haskell-cafe at haskell.org
Subject: [Haskell-cafe] Re: Newbie question about tuples

peterv <bf3 at telenet.be> wrote in article
<013301c7c54e$25232650$6f6972f0$@be> in gmane.comp.lang.haskell.cafe:
> 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 at 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
 



More information about the Haskell-Cafe mailing list