Karl-Filip: >But what I really meant is, if I may rephrase it, that imperative >programs might often be both faster and harder to write because they >embed more information about the abblication domain. That is, if you >code in C and want an array, you must specify its size, so you have to >think about your program and figure out that you only need 'x' items >here, wheras in Haskell you'd use a list and never have to think about >what the upper bound on the length of the list is.
Yes indeed. But sometimes the length of a list being returned from a function can be a simple function of the function arguments (or the sizes of the arguments), think of map for instance. In such cases, a static program analysis can sometimes find the length function. If we know thee functions for all list-producing functions in a closed program, then the lists could be represented by arrays rather than linked structures. I know Christoph Herrmann worked on such a program analysis some years ago. Also, I think Manuel Hermenegildo has done this for some logic language. Could sized types be used for this purpose? (I must find myself some time to read Lars Pareto's PhD thesis...) Björn Lisper _______________________________________________ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell