Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
additions to standard library?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2000-03-10 (08:07)
From: Thorsten Ohl <ohl@h...>
Subject: additions to standard library?
Markus Mottl <> writes:

> Hello, it sometimes happens that I need functions on abstract data
            ^^^^^^^^^ often :-)
> types in the standard library which are not available there, but
> could be considered as "usual" operations on such data.

> Some specific examples include, e.g.:

My favorites are Map and List, of which I keep carrying around
turbocharged versions.

> CVS-repository [...] "peer review"

That's a brilliant idea!

Here's another issue in the same problem domain, that might be more
interesting for developers: wouldn't it be possible to add a language
feature that allows to extend module implementations without opening
the pandora box of classes with inheritance?

Currently, we can use `include' to extend module types, but not
implementations.  I'm thinking of something like

    module type ThoList =
    	include List  (* doesn't work because list.mli is a file,
                         but you get the idea :-) *)
    	val flatmap : ('a -> 'b list) -> 'a list -> 'b list
    module ThoList : ThoList=
    	include List
    	let rec flatmap f = function
    	  | [] -> []
    	  | x :: rest -> f x @ flatmap f rest
Thorsten Ohl, Physics Department, TU Darmstadt -- [<=== PGP public key here]