[erlang-questions] Intel Quad CPUs
Richard Carlsson
richardc@REDACTED
Fri Sep 7 11:18:37 CEST 2007
Damien Morton wrote:
> Allow me to apologise in advance for my ignorance, but why do edoc type
> specifications look like function calls?
The notation actually goes back to some early work on types in Erlang
by Phil Wadler and Simon Marlow ("A practical subtyping system for
Erlang", ICFP '97) - their ideas didn't fly, because they would cause
a lot of existing code (already in '97) to be simply rejected by the
compiler, and that just wasn't realistic. But the notation lives on,
and has been used both in edoc and in every other work on typing in
Erlang that I know of.
Apart from separating atoms from types, note that it also easily
extends to parameterized types, such as ordset(integer()), or
dict(atom(), string()), so that it looks like function calls
is quite natural when you think about it.
/Richard
More information about the erlang-questions
mailing list