--- Malcolm Wallace wrote:
As an example, instead of the following list-only code,
f :: List a - ...
f []= ...
f (h:t) = ...
you could write this more general version, which assumes only some
class Sequence with operations null, head, tail, etc.
f :: Sequence s = s a - ...
Robert Dockins wrote:
BTW can you give some references to these known techniques?
See also, Purely Functional Data Structures by Chris Okasaki for
functional implementations of queues, dequeues, etc.
www-2.cs.cmu.edu/~rwh/theses/okasaki.pdf
Greg Buchholz
Apologies if this is the wrong mailing list in which to
pester folks with Newbie Questions, but I couldn't find my answer after half an
hour of scouring the Haskell Report, the Haskell Wiki, the School of _expression_
book and a couple of tutorials. The frustrating thing is that I know I saw