[erlang-questions] encapsulating types and dialyzer

Anthony Shipman <>
Thu Sep 11 17:45:30 CEST 2008


Suppose I have a module MC that implements a collection type known as coll(). 
Internally this is some record that I want to be private to the module.

The external functions in the interface mention the type coll(). So the 
clients of the interface must also mention coll() if dialyzer is to check the 
types.

As far as I can see the only way to do this is to put the coll() type into 
a .hrl file. This exposes the record definition, and recursively every other 
type that it depends on.

Is there a better way to do this? 

C at least allows me to declare a type abstractly
	typedef struct private*  coll;
while leaving private undefined everywhere except in the implementing module.

-- 
Anthony Shipman                    Mamas don't let your babies 
                   grow up to be outsourced.



More information about the erlang-questions mailing list