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

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Fri Feb 8 11:23:57 EST 2008


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.

-- 
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH




More information about the Haskell-Cafe mailing list