<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Oops! Sorry for the typos! Fixing that below.<br>
<br>
Hi All,
<br>
<br>
My understanding is that a functor in Haskell is made of two "maps".
<br>
One that maps objects to objects that in Hask means types into types
(i.e. a type constructor)
<br>
And one that maps arrows into arrows, i.e. fmap.
<br>
<br>
My understanding is that a functor F in category theory is required
to preserve the domain and codomain of arrows, but it doesn't have
to be injective. In other words, two objects X and Y of category C
(i.e. two types in Hask) can be mapped into the same object Z (same
type) in category D. As long as the "homomorphism" law holds:
<br>
<br>
F(f:X->Y) = F(f):F(X)->F(Y)
<br>
<br>
However, I don't think there is any way this mapping of types cannot
be injective in Haskell. It seems that a type constructor, when
called with two distinct type will always yield another two <b
class="moz-txt-star"><span class="moz-txt-tag">*</span>distinct<span
class="moz-txt-tag">*</span></b> types. (E.g. Int and Double
yield Maybe Int and Maybe Double) So, it seems that Functors in
Haskell are actually more restrictive than functors can be in
general. Is this observation correct or did I misunderstand
something?
<br>
<br>
<br>
Thanks!
<br>
<br>
<br>
Dimitri
<br>
<br>
<div class="moz-cite-prefix">Em 05/07/14 02:42, Dimitri DeFigueiredo
escreveu:<br>
</div>
<blockquote cite="mid:53B79060.1040800@ucdavis.edu" type="cite">Hi
All,
<br>
<br>
My understanding is that a functor in Haskell is made of two
"maps".
<br>
One that maps objects to objects that in Hask means types into
types (i.e. a type constructor)
<br>
And one that maps arrows into arrows, i.e. fmap.
<br>
<br>
My understanding is that a functor F in category theory is
required to preserve the domain and codomain of arrows, but it
doesn't have to be injective. In other words, two objects X and Y
of category C (i.e. two types in Hask) can be mapped into the same
object Z (same type) in category Z. As long as the "homomorphism"
law holds:
<br>
<br>
F(f:X->Y) = F(f):F(X)->F(Y)
<br>
<br>
However, I don't think there is any way this mapping of types
cannot be injective in Haskell. It seems that a type constructor,
when called with two distinct type will always yield another two
*distinct* types. (E.g. Int and Fload yield Maybe Int and Maybe)
So, it seems that Functors in Haskell are actually more
restrictive than functors can be in general. Is this observation
correct or did I misunderstand something?
<br>
<br>
<br>
Thanks!
<br>
<br>
<br>
Dimitri
<br>
<br>
<br>
_______________________________________________
<br>
Beginners mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:Beginners@haskell.org">Beginners@haskell.org</a>
<br>
<a class="moz-txt-link-freetext" href="http://www.haskell.org/mailman/listinfo/beginners">http://www.haskell.org/mailman/listinfo/beginners</a>
<br>
</blockquote>
<br>
</body>
</html>