[Haskell-cafe] Vectors, vector spaces and type-level Haskell

Branimir Maksimovic branimir.maksimovic at gmail.com
Mon Oct 4 05:25:04 UTC 2021


2d vector space is generated by two base vectors, if, which are orthogonal,
that is normalised. They generate any other vector in that space.

Greetings, Branimir.

> On 04.10.2021., at 05:35, Stuart Hungerford <stuart.hungerford at gmail.com> wrote:
> 
> Greetings Haskellers,
> 
> I'd like to model in Haskell two-dimensional vectors that "belong to"
> or "have an ambient space of" a two dimensional vector space. I'm also
> ignoring for now the issue of which field the vector space is over. I
> realize this is not strictly necessary to just start using 2D vectors,
> but I would like to bring the vector space in as a first class
> concept.
> 
> Looking at for example this approach:
> https://hackage.haskell.org/package/linear-1.21.7/docs/Linear-V2.html,
> I get the impression this is likely to need some kind of type-level
> construct?  e.g. type families or type-level literals?
> 
> I haven't started learning yet about Haskell type-level programming so
> I thought I'd ask for advice first to see how this could be done
> idiomatically in Haskell either with or without type-level concepts.
> 
> TIA,
> 
> Stu
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.



More information about the Haskell-Cafe mailing list