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

Isaac Dupree isaacdupree at charter.net
Thu Jan 31 23:11:08 EST 2008


Wolfgang Jeltsch wrote:
> Well, the representation (D1,D2,D9) might be considered more readable.  It has 
> the disadvantage of a fixed maximum size for the numbers.  Which takes me to 
> a point I had already considered some time ago: Wouldn’t it be good if we had 
> just a type
> 
>     data Pair val1 val2 = Pair val1 val2
> 
> and if then (val1,val2,…,valn) would just be syntactic sugar for this:
> 
>     val1 `Pair` (val2 `Pair` (…(valn `Pair` ())…))

I've thought of that too.. besides the asymmetry, the presence of 
_|_/seq makes them actually not equivalent though, unfortunately

~Isaac


More information about the Haskell-Cafe mailing list