Enhanced type guard syntax]

Vlad Dumitrescu vlad_dumitrescu@REDACTED
Fri Sep 19 11:23:12 CEST 2003

From: "Peter-Henry Mander"
> > - return {list_of_integers, Value} from all functions that compute such a
> Not necessarily, for example:
>     sum({list_of_integers, Value}) -> ... {integer,Sum}.
> or
>     sum({list_of_integers, Value}) -> ... Sum.
> is a design issue.
> Or am I missing your point?

No it was my point :-) What I was thinking about was that using this scheme from
the very start of the development (i.e. prototyping) would make it no nolger be
rapid, which is a very good thing about Erlang. To introduce the tags at a later
stage is cumbersome.

> This scheme must be applied throughout where "types" are required for it
> to work, and I agree that it can become tiresome to write, but design it
> right and it will save some pain later.
> If you return tagged types, it will force users of the function to honor
> the type scheme, and isn't that what the goal is?

I am not sure if forcing developers to do things in a more convoluted way is
always a good thing, even if there are gains somewhere else. What I think of is
the Java exception declaration for each method - it is useful in some ways, but
a pain while developing.

To sum my point, I think the idea is interesting and I hope it will lead to
something really useful.


More information about the erlang-questions mailing list