why the parentheses after typenames?

Matthias Lang matthias@REDACTED
Sun Feb 27 20:00:12 CET 2005


something I've wondered a few times. In the documentation, types are
often denoted by putting parentheses after names, e.g.

   len(String) -> Length

            String = string()
            Length = integer()

what's behind this? Is there an explanation somewhere?

Another example: (from erlang:nodes/0)

           ArgList = [ArgAtom]

I'm guessing "[ArgAtom]" means "a list of ArgAtom which may be
empty". But how do I express the return type consisting of a list with
exactly one element?

Does all this come from one of the earlier type checkers?


More information about the erlang-questions mailing list