Subsequence references or substrings in OCaml

From: Brian Rogoff (bpr@best.com)
Date: Fri Dec 18 1998 - 20:27:57 MET


Date: Fri, 18 Dec 1998 11:27:57 -0800 (PST)
From: Brian Rogoff <bpr@best.com>
To: caml-list@inria.fr
Subject: Subsequence references or substrings in OCaml

Hi,

I've been doing a lot of string processing lately and trying to determine
the correct "functional" approach to string processing. In SML '97 (hey,
you've got to look at the competition ;-) the Basis Library has a
signature SUBSTRING which has a substring type, whose values are just
triples (s,i,n) where i is the starting index and n the size of the string
s. It turns out that many algorithms are simplified by using this kind of
representation for strings.

It also turns out that similar string representations have been used
before; if you hop over to http://www.cs.cmu.edu/~wjh/papers/ you'll see
that "subsequence references" are pretty much the same thing.

Its simple enough to implement subsequence references as a user defined
type in OCaml, as I've done, but I am curious about whether anyone else
who has used similar libraries would find a built-in substring or
subsequence ref library useful.

-- Brian



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:17 MET