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

Isaac Dupree isaacdupree at charter.net
Fri Feb 1 22:10:11 EST 2008


Wolfgang Jeltsch wrote:
> Am Freitag, 1. Februar 2008 05:11 schrieben Sie:
>> 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
> 
> With Ryan’s proposal (using strictness annotations) the new representation 
> should be equivalent to the old one.  Or am I missing something?

adding the strictness annotation seems to make them equivalent, yes I 
agree (I hadn't seen that post when I wrote that reply)

~Isaac


More information about the Haskell-Cafe mailing list