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

Isaac Dupree isaacdupree at charter.net
Thu Jan 31 23:14:34 EST 2008


> You could solve it this way:
>> data PairL a b = PairL a !b
> 
> where (a,b,c) is syntactic sugar for
> PairL a (PairL b (PairL c ()))


> There are still potential efficiency issues, although this could be
> worked out in the compiler; right now it's a single operation to get
> from a tuple to any member, but in PairL it takes n operations to get
> from the root to the nth elment of the tuple.  The
> "unbox-strict-fields" optimization can fix this.

can it really fix that for polymorphic members?


More information about the Haskell-Cafe mailing list