From: Stefano Z. <za...@bo...> - 2003-03-02 09:51:06
|
I've dug a bit more in some old ocaml sources and I've found some additional functions that IMO are worth while to be inserted in the standard library: (* find functions on arrays, similar to List's *) val Array.exists: ('a -> bool) -> 'a array -> bool val Array.for_all: ('a -> bool) -> 'a array -> bool val Array.find: ('a -> bool) -> 'a array -> 'a (* rotations on lists and arrays, step defaults to 1 *) val Array.lrotate: ?step:int -> 'a array -> 'a array val Array.rrotate: ?step:int -> 'a array -> 'a array val List.lrotate: ?step:int -> 'a list -> 'a list val List.rrotate: ?step:int -> 'a list -> 'a list Hope this helps. Cheers. -- Stefano Zacchiroli - Undergraduate Student of CS @ Uni. Bologna, Italy zack@{cs.unibo.it,debian.org,bononia.it} - http://www.bononia.it/zack/ " I know you believe you understood what you think I said, but I am not sure you realize that what you heard is not what I meant! " -- G.Romney |