[erlang-questions] Understanding Erlang types with type variables

Karlo Kuna kuna.prime@REDACTED
Tue Feb 27 21:45:01 CET 2018


yes this is correct

On Wed, Feb 21, 2018 at 11:39 AM, Athanasios Valsamakis <
athanasios.valsamakis@REDACTED> wrote:

> In Erlang, you can have a (generic) type declaration parameterized with
> type variables e.g.
>
> -type dict(K, V) :: [{K,V}].
>
> K, V are type variables i.e. they can be replaced in subsequent type
> declarations or function specifications with concrete types. E.g.
>
> -type catalog() :: dict(string(), integer()).
>
> Here K is replaced with type string(), and V with type integer(). Or, it
> can be used in function specifications e.g.
>
> -spec find(string(), dict(string(), any())) -> any().
>
> Is it correct?
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20180227/e3dd8a09/attachment.htm>


More information about the erlang-questions mailing list