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

Henning Thielemann lemming at henning-thielemann.de
Fri Feb 8 10:25:19 EST 2008

On Fri, 8 Feb 2008, Wolfgang Jeltsch wrote:

> Am Donnerstag, 7. Februar 2008 16:31 schrieben Sie:
> >
> > Even if () would be preferred from the programmers point of view (I'm
> > not sure how much we could reduce the number of instances though), it
> > makes the representation less attractive on the user-side. Anyone
> > using the library would find it annoying and would wonder why is it
> > neccessary.
> I wouldn’t wonder.  Leaving out the () :* part just works because our
> type-level “values” are not typed, i.e., there aren’t different kinds Digit
> and Number but only kind *.  If :+ would be a data constructor (on the value
> level), it would take a number and a digit argument which would forbid using
> a digit as its left argument.  So I consider using a digit on the left
> as “unclean”.  It’s similar to using a number as the second part of a cons
> cell in LISP.


More information about the Haskell-Cafe mailing list