[erlang-questions] NIF resource and typespecs

Sverker Eriksson <>
Thu Apr 10 12:11:48 CEST 2014


On 04/09/2014 03:25 PM, Loïc Hoguin wrote:
> Hello,
>
> NIF resources appear as a magic empty binary on the Erlang side. What 
> typespec should I use for them though? Is there anything better than 
> this?
>
> -opaque my_nif_resource() :: any().
>
> Thanks.
>

I think this is the way to go:

-type my_nif_resource() :: any().


@Tuncer: Wasn't that your conclusion?


/Sverker, Erlang/OTP





More information about the erlang-questions mailing list