[Haskell-cafe] Reference for technique wanted

Richard O'Keefe ok at cs.otago.ac.nz
Wed Nov 3 23:27:26 EDT 2010


On 3/11/2010, at 9:50 PM, Claus Reinke wrote:


The bottom line is that

 - in logic programming languages, building a list by working on
   a pair of arguments representing a segment of the list is the
   NORMAL way to build a list; it's as fast as it gets, and the
   list is inspectable during construction.

 - at least in SML, the (fn ys => xs @ ys)  [Haskell: \ys -> xs ++ ys]
   approach is stunningly slow, so slow as to make even naive use of
   append more attractive for most uses of; it is not the normal way
   to build lists, and for good reason; you can do nothing with a list
   so represented except compose and apply.

The practical consequence of this is that calling both techniques by
the same name is going to mislead people familiar with one kind of
language when they use the other:  logic programmers will wrongly
expect dlists to be practically useful in functional languags,
functional programmers will expect them to be impractical in logic
programming languages.




More information about the Haskell-Cafe mailing list