[Haskell-cafe] Re: Implementing fixed-sized vectors (using datatype algebra?)

Henning Thielemann lemming at henning-thielemann.de
Fri Feb 8 11:28:44 EST 2008


On Fri, 8 Feb 2008, Brandon S. Allbery KF8NH wrote:

> On Feb 8, 2008, at 11:14 , Stefan Monnier wrote:
>
> >>>> You seem to write 12 as 1 :+ 2 instead of () :+ 1 :+ 2.  But I
> >>>> think, the
> >>>> latter representation should probably be prefered.
> >>>> (...)
> > How 'bout treating :+ as similar to `append' rather than similar to
> > `cons'?
> > Basically treat :+ as taking 2 numbers (rather than a number and
> > a digit).
>
> Dumb questions department:  why not define e.g. D'0 .. D'9 as () :*
> 0 .. () :* 9?  Programmers then get D'1 :* 2, but the library sees
> () :* 1 :* 2.

Do you remember that they talk about types D0, D1, and so on?


More information about the Haskell-Cafe mailing list