[Haskell-cafe] Re: Positive integers

Aaron Denney wnoise at ofb.net
Fri Mar 24 13:54:54 EST 2006

On 2006-03-24, Henning Thielemann <lemming at henning-thielemann.de> wrote:
> On Fri, 24 Mar 2006, Aaron Denney wrote:
>> Basically, my big objection is that it's hard to define many useful
>> operations on them that are statically safe.
> Why not defining the Torsor class you suggested?

Torsor is not quite the right word -- it's just that one of the contexts
for non-negative numbers is very similar to one fairly standard example
of torsors -- pointers and offsets.

>> Now granted, the numeric hierarchy should be broken up a bit (hmm, I
>> should finish my strawman proposal for Haskell'), but even then I see
>> problems.
> Hm, is there something going on?

A strawman proposal, not yet posted anywhere.

> Without breaking compatibility?
> But class instances become invalid if the hierarchy is modified.

No, compatibility will be broken.  Hopefully not for most uses -- I
don't think most people define new instances, and those that do will be
able to do so more reasonably, so hopefully wouldn't mind.

> If there is some 
> progress towards a refined numeric class hierarchy I want to point again 
> to
>   http://cvs.haskell.org/darcs/numericprelude/
>   http://cvs.haskell.org/darcs/numericprelude/src/Algebra/Core.lhs
>    I hope I don't annoy you. :-)

Not at all.  That is one of the things I looked at a while ago, that has
inspired a lot of my decisions -- but I'm more willing to rename things
that I think have silly names.  And there are a few minor details, like 
allowing only for euclidean domains rather than principal ideal domains.

I will probably actually put two proposals up, with one allowing more
generality via MPTCs and FDs (which I truly hope make it into the

Aaron Denney

More information about the Haskell-Cafe mailing list