Stream: beginners

Topic: is Num.maxNat a thing?


view this post on Zulip Asbjørn Olling (Dec 06 2023 at 16:30):

The documentation mentions it, but it's not listed in the list of functions, and I can't seem to run it in a repl either.

To work around it, I just used Num.toNat Num.maxU64 instead. But I guess that will overflow on 32-bit machines?

view this post on Zulip Asbjørn Olling (Dec 06 2023 at 16:33):

..and maybe in wasm too? I guess it's probably better to use Num.maxU32instead if I want my code to be portable.

view this post on Zulip Asbjørn Olling (Dec 06 2023 at 16:33):

...I guess it's probably better not to use Nat, if I want my code to be portable :sweat_smile:

view this post on Zulip Richard Feldman (Dec 06 2023 at 16:37):

yeah we're actually in the process of removing Nat from the language for that reason!

view this post on Zulip Asbjørn Olling (Dec 06 2023 at 16:38):

cool, that seems reasonable. I'll start using U32 or something instead.

view this post on Zulip Anton (Dec 06 2023 at 17:15):

I'll update the docs


Last updated: Jul 06 2025 at 12:14 UTC