27 Jun
2005
27 Jun
'05
12:39 a.m.
On Tue, 14 Jun 2005, Bulat Ziganshin wrote:
Hello Keean,
Tuesday, June 14, 2005, 3:54:08 PM, you wrote:
KS> class Functor m where KS> fmap :: a -> b -> m a -> m b
KS> But the type of "mmap" is
KS> mmap :: e -> e -> Matrix a i e -> Matrix a i e
KS> in other words we map values to the same type, not a different type.
mmap should be
mmap :: (e -> e1) -> Matrix a i e -> Matrix a i e1
for example, we can map matrix of strings to matrix of its lengths
... or a real valued matrix to a complex valued one.