[Haskell-beginners] Are functors in Haskell always injective?

Kim-Ee Yeoh ky3 at atamo.com
Sat Jul 5 23:38:57 UTC 2014


On Sun, Jul 6, 2014 at 12:27 AM, Brent Yorgey <byorgey at seas.upenn.edu>
wrote:

> On Sat, Jul 05, 2014 at 02:51:07AM -0300, Dimitri DeFigueiredo wrote:
> >
> > 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 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?
>
> Yes, that's correct.


Why is that correct? How would you show that?

-- Kim-Ee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20140706/b20dcd64/attachment-0001.html>


More information about the Beginners mailing list