[Haskell-cafe] Matrices as Applicatives and Monads

Daniel Díaz Casanueva dhelta.diaz at gmail.com
Tue Feb 9 05:59:18 UTC 2016


Hey,

I don't currently have the time to go into details, but you might want to
take look at this:

https://github.com/Daniel-Diaz/matrix/blob/555cb93a759536cd9ff03059ec4b813640607c89/Data/Matrix.hs#L177

It is inspired by tensor product.

Monad is not possible though. Think about how would you implement the
'join' function.

I hope that helps!

Best,
Daniel Díaz.

On Tue, Feb 9, 2016 at 3:02 AM, Strikingwolf2012 . <
strikingwolf2012 at gmail.com> wrote:

> I have been writing code encoding matrices here
> <https://github.com/Strikingwolf/Learning/blob/master/haskell/src/math/Matrix.hs> as
> a learning experience. However, I cannot figure out a method to make Matrix
> an instance of Applicative and Monad. I believe it is possible, but I
> cannot find an implementation. For context my form of Matrix does not have
> a requirement to be of integers, it is just a 2-Dimensional array in
> essence. Thank you in advance for any help you may provide :)
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20160209/2416aa89/attachment.html>


More information about the Haskell-Cafe mailing list