[Haskell-beginners] Capture the notion of invertible functions

Kim-Ee Yeoh ky3 at atamo.com
Mon Mar 17 19:48:21 UTC 2014


> When you're talking about invertible functions, the idea you're probably
reaching for is an isomorphism -- that is, we want the function to have
certain nice properties on top of just being a map from a -> b with an
inverse map from b -> a.

The usual meaning of 'f is invertible' is that it is both left- and
right-invertible, thus making it bijective: see first bullet in [1].

Here you're alluding to f being merely left-invertible, something I don't
see mentioned in OP.

> You also want the function to be a bijection, which is captured in the
notion of an isomorphism.

I'm reminded of a reddit convo where the idea was tossed out that
semigroups should always be promoted to monoids [2].

I argued no. I also cited a case where a supposedly nicer monoid causes
more problems for a ghc hacker than the true semigroup [3].

Having structure is nice. And sometimes we just have to work with what's
given to us.

Category theory calls a /monomorphism/ something that's strictly weaker
than left-invertible. An arrow that's (additionally) left-invertible
corresponds to a /split mono/.

Hence in order of _decreasing_ niceness: Iso, Split mono, Mono. As research
uncovers more interesting phenomena, this sequence will continuing growing
to the right.

We can't always impose that niceness because that nukes whatever we're
studying. So we gotta respect the situation. And given lemons, make
lemonade.


[1]
http://en.wikipedia.org/wiki/Bijection,_injection_and_surjection#Bijection

[2]
http://www.reddit.com/r/haskell/comments/1ou06l/improving_applicative_donotation/ccvtqot?context=1

[3]
http://www.reddit.com/r/haskell/comments/1ou06l/improving_applicative_donotation/ccy4n2d
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20140318/04565dde/attachment-0001.html>


More information about the Beginners mailing list