PROPOSAL: Add 'Natural' type to base:Data.Word

Herbert Valerio Riedel hvr at gnu.org
Thu Nov 13 07:27:38 UTC 2014


On 2014-11-11 at 10:35:20 +0100, Herbert Valerio Riedel wrote:
> Hello CLC et al.,
>
> I hereby suggest to add a type for encoding term-level naturals
>
>   data Natural = <opaque/hidden>
>        deriving (...the usual standard classes...)
>
> to `base:Data.Word` module

FYI, here's a first draft for its implementation

  https://phabricator.haskell.org/D473

It currently uses non-saturating arithmetic, but that's not set in stone.

A test-suite is in the works; if you notice anything odd in the code,
please annotate the patch (click on the line-numbers to create an
inline-comment, and don't forget to commit all inline annotations by
submitting the comment-form at the bottom of that page)


Cheers,
  hvr


More information about the Libraries mailing list