[Haskell-cafe] Re: Can we do better than duplicate APIs? [was: Data.CompactString 0.3]

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Wed Mar 28 19:43:40 EDT 2007


On Wed, 2007-03-28 at 20:44 +0200, Benjamin Franksen wrote:

> But... you have the type of all functions nailed down in classes. Thus, even
> if a change in the API means a lot of tedious work adapting the concrete
> implementations, at least the compiler helps you to check that the
> implementations will conform to the interface (class); and users have to
> consult only the API docs, and not every single function in all 20
> implementations. With ByteString and friends there is (yet) no common
> interface laid down anywhere. All the commonality is based on custom and
> good sense and the willingness and ability of the developers to make their
> interfaces compatible to those of others.

Remember that there's more to an API than a bunch of types. The type
class only ensures common types.

You must still rely on the good sense and ability of the developers to
ensure other properties like strictness, time complexity and simply what
the functions should do.

Duncan



More information about the Haskell-Cafe mailing list