On 19/01/2011 22:02, Leif Warner wrote:
In the documentation in mentions that String is just an alias for
[Char], but it doesn't seem to let me use any list functions on a string.

For example, attempting "dropWhile" fails with:
links> dropWhile(fun(x){x=='h'}, "hello");
<stdin>:1: Type error: The function
     `dropWhile'
has type
     `((Char) ~a~> Bool, [Char]) ~a~> [Char]'
while the arguments passed to it have types
     `(Char) ~> Bool'
and
     `String'
and the currently allowed effects are
     `wild|_'.
In expression: dropWhile(fun(x){x=='h'}, "hello").

Using yesterday's SVN build on OCaml 3.12.0.

-Leif Warner

Indeed. In the trunk we've changed String to be a base type. Unfortunately, the documentation and some of the library functions such as dropWhile are lagging behind.

Sam
_______________________________________________
links-users mailing list
[email protected]
http://lists.inf.ed.ac.uk/mailman/listinfo/links-users

--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

Reply via email to