[erlang-questions] Type contracts [WAS: Re: Intel Quad CPUs]

Kostis Sagonas kostis@REDACTED
Fri Sep 7 16:21:47 CEST 2007


Tony Finch wrote:
> On Thu, 6 Sep 2007, Kostis Sagonas wrote:
>>      there needs to be way to distinguish between atoms (i.e.
>>      singleton types) and type names.
>>
>>      Some types can also take parameters.
> 
> I'd suggest using initial caps for type names...

This does not work since the contracts will also be able to take type 
variables.  For example, this is the type of lists:map/2:

   -spec(map/2 :: (((A) -> B), list(A)) -> list(B))).

also written more simply as:

   -spec(map/2 :: (((A) -> B), [A]) -> [B])).


Kostis



More information about the erlang-questions mailing list