addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupshelp-with-circleimageimagesinstagramlinklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruserwarningyahoo

erlang docs: function signatures and "::"

From: Jonathan R.
Sent on: Saturday, September 7, 2013 3:25 PM
There seems to be an inconsistency in Erlang docs which I found very confusing. Here is an example:

In stdlib's string module, 

len(String) -> Length


String = string()
Length = integer() >= 0

Returns the number of characters in the string.

In the edoc module,

Runs EDoc on a given set of source files. See run/3 for details, including options.

In the first case, only the parameter 'String' is shown in the argument list, and the argument types are described later.

In the second case, the parameter name and the parameter type(s) are smushed together with the "::" connector. It took me a while to figure out what the "::" meant in this context.

Does anyone know if there is some sort of principle behind this? Is there some Erlang doc page that explains the various documentation conventions? I have looked around the online docs and haven't spotted such an explanation. If you haven't seen it before, it is not obvious.



Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy