> Vector (Complex a) is a vector with respect to both 'a' and 'Complex a'.<br><br>Even worse, () is a vector w.r.t. *every* scalar type.<br><br><div class="gmail_quote">On Sat, Oct 30, 2010 at 3:07 AM, Henning Thielemann <span dir="ltr"><<a href="mailto:schlepptop@henning-thielemann.de">schlepptop@henning-thielemann.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">wren ng thornton schrieb:<br>
<div class="im">> On 10/22/10 8:46 AM, Alexey Khudyakov wrote:<br>
>> Hello everyone!<br>
>><br>
>> It's well known that Num & Co type classes are not adequate for vectors<br>
>> (I don't mean arrays). I have an idea how to address this problem.<br>
>><br>
>> Conal Elliott wrote very nice set of type classes for vectors.<br>
>> (Definition below). I used them for some time and quite pleased. Code is<br>
>> concise and readable.<br>
>><br>
>> > class AdditiveGroup v where<br>
>> > zeroV :: v<br>
>> > (^+^) :: v -> v -> v<br>
>> > negateV :: v -> v<br>
>> [...]<br>
>> I'd like to know opinion of haskellers on this and specifically opinion<br>
>> of Conal Eliott as author and maintainer (I CC'ed him)<br>
<br>
</div>Looks like you are about to re-implement numeric-prelude. :-)<br>
<div class="im"><br>
> Just my standard complaint: lack of support for semirings, modules, and<br>
> other simple/general structures. How come everyone's in such a hurry to<br>
> run off towards Euclidean spaces et al.?<br>
><br>
> I'd rather see,<br>
><br>
> class Additive v where -- or AdditiveMonoid, if preferred<br>
> zeroV :: v<br>
> (^+^) :: v -> v -> v<br>
><br>
> class Additive v => AdditiveGroup v where<br>
> negateV :: v -> v<br>
><br>
> type family Scalar :: * -> *<br>
<br>
</div>Vector (Complex a) is a vector with respect to both 'a' and 'Complex a'.<br>
<div><div></div><div class="h5"><br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br>