[erlang-questions] How to define non_neg_float() type specification?

Zhemzhitsky Sergey Sergey_Zhemzhitsky@REDACTED
Fri Sep 28 08:47:21 CEST 2012


Hello Stavros,

Thanks for suggestion!

Best Regards,
Sergey

From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Stavros Aronis
Sent: Thursday, September 27, 2012 8:47 PM
To: erlang-programming@REDACTED
Cc: Erlang-Questions Questions
Subject: Re: [erlang-questions] How to define non_neg_float() type specification?

Sorry, that was:

-type non_neg_float() :: float().

Stavros

On Thursday, September 27, 2012 6:32:47 PM UTC+2, Stavros Aronis wrote:
Hello!

Unfortunately Dialyzer does not support it (even constants are generalized to any float, typwise). Consequentially, the type language does tnot support it.
You can maybe try:

-type define non_neg_float() :: float().

This will help you documentation-wise and also (though in a somewhat limited way) Dialyzer-wise. If you use this type PropEr-wise however, you will get positive values, which you will need to filter...

Stavros

On Thursday, September 27, 2012 6:10:14 PM UTC+2, Zhemzhitsky Sergey wrote:
Hello erlangers,

Is it possible to define non_neg_float() type specification somehow?

Best Regards,
Sergey


_______________________________________________________



The information contained in this message may be privileged and conf idential and protected from disclosure. If you are not the original intended recipient, you are hereby notified that any review, retransmission, dissemination, or other use of, or taking of any action in reliance upon, this information is prohibited. If you have received this communication in error, please notify the sender immediately by replying to this message and delete it from your computer. Thank you for your cooperation. Troika Dialog, Russia.

If you need assistance please contact our Contact Center (+7495) 258 0500 or go to www.troika.ru/eng/Contacts/system.wbp<http://www.troika.ru/eng/Contacts/system.wbp>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120928/0e450505/attachment.htm>


More information about the erlang-questions mailing list