Question of defining Type Class

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Question of defining Type Class

Shinichi Higashino
I am confusing since I am trying to define
Abstract sense of Matrix;

class Mat

- is a more abstract concept since 1x1 Matrix is isomorphic to Num
- is a more abstract concept since 1xn Matrix is isomorphic to Vector

So,

class Mat a => Num a where …
class Mat a => Vec a where …

should be .

However, I know that the Initial object of Ring Category is Integer .
So, I should start with Z and then I should define

class ( Module R on Z )

But I could not find that kind of definition in Haskell.
Is it Data.Ring ?

I am so confusing now…
Please help me if you are drinking some tea just now!
_______________________________________________
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.
Reply | Threaded
Open this post in threaded view
|

Re: Question of defining Type Class

Shinichi Higashino
Sorry, I found it.


> On May 23, 2018, at 0:50, Shinichi Higashino <[hidden email]> wrote:
>
> I am confusing since I am trying to define
> Abstract sense of Matrix;
>
> class Mat
>
> - is a more abstract concept since 1x1 Matrix is isomorphic to Num
> - is a more abstract concept since 1xn Matrix is isomorphic to Vector
>
> So,
>
> class Mat a => Num a where …
> class Mat a => Vec a where …
>
> should be .
>
> However, I know that the Initial object of Ring Category is Integer .
> So, I should start with Z and then I should define
>
> class ( Module R on Z )
>
> But I could not find that kind of definition in Haskell.
> Is it Data.Ring ?
>
> I am so confusing now…
> Please help me if you are drinking some tea just now!

_______________________________________________
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.