Export Natural type from prelude

Oliver Charles ollie at ocharles.org.uk
Fri Jul 2 16:43:00 UTC 2021


On Fri, 2 Jul 2021, at 4:56 PM, Henning Thielemann wrote:
> 
> On Fri, 2 Jul 2021, Oliver Charles wrote:
> 
> > Not to derail, but I am +1 on the original suggestion, but +10 on Int* and Word*
> 
> Can people please not only say +1, but also tell some reasons?

Natural is frequently a much more correct type than Int or Integer, as it naturally (ha) rules out needing to think about negative cases.

Int* and Word* are frequently what I need to ultimately consume or produce. I don't agree they are "low-level", unless we consider any boundary to be low-level. But even then, if I ultimately have to produce Int64, I don't want to overflow a million miles away and then suddenly fail at the boundary. Int64 _is_ the correct type throughout the whole system I'm building. Unless my whole system is low-level, but that's a subjective judgement. I also don't think we can consider Int any less low-level - it's still bounded, but in a sense even less predictably due to varying depending on the underlying architecture.

Due to needing them frequently, I just find it tedious to have to import them every time when they are perfectly uncontroversial (well, to me, anyway).

Ollie
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20210702/e9a2d0e9/attachment.html>


More information about the Libraries mailing list