# The Mathematics of Functors (by Dr. Shaun Martin)

• Jan 24, 2014 · 7:30 PM

Introduction:

We are happy to be able to invite Dr. Shaun Martin to give us a talk in pure mathematics. This talk would be about why functors are invented, how you can do some cool things with them. And its relation with Haskell.

Speaker Profile:

Dr Shaun Martin is the co-founder of Applied Cognitive Science: a company that uses cognitive science, behavioral economics and data science to build predictive models for strategic planning, innovation, and public policy.

Prior to founding Applied Cognitive Science he worked in academia: holding lecturing and research positions at MIT and at the Institute for Advanced Study at Princeton. He holds a DPhil from Oxford University.

• ##### Edwin J. P.

To follow up on my question about the automatic derivation of functors in haskell.. Is there a result that says, there is a unique instance of a functor for single parametric types? Perhaps that's why automatic derivation of functors is possible in haskell.

January 24, 2014

• ##### Edwin J. P.

Hmm. I realize my mistake. Perhaps -XDeriveFunctor uses some type of constraint solver to see if both laws are satisfied and if it can't find one it just spits an error and gives up.

January 31, 2014

• ##### Herng Y.

If Haskell allows "ad-hoc polymorphism" (http://en.wikipedia.o...­), or more specifically allows a function to inspect the type of one of its arguments, then I can define a type that has one Functor law-abiding instance for every integer k.

data MorphInt a = MorphInt a
instance Functor MorphInt where
fmap f (MorphInt a) = if (f :: Int -> Int) (MorphInt (f (a - k)) + k) (MorphInt (f a))

fmap here handles the type (Int -> Int) differently from other types (ad-hoc polymorphism: http://en.wikipedia.o...­).

January 31, 2014

• ##### A former member

Interesting talk

January 25, 2014

• ##### Edwin J. P.

To answer the question about the philosophy behind using category theoretic constructs in Haskell: category theory has done an excellent job to unify various brands of mathematics. People like to believe it will do the same for all knowledge including complex software we use daily. Such unification implies a more precise specification of common Design Patterns software engineers have discovered by trial and error. A precise specification of design patterns implies automatic methods to verify whether the patterns were followed by a novice programmer working on your code base. Ultimately software engineers aim to achieve the Hilbert's trams humanist dream of automatic reasoning and obsolescence of the human mind and it's pretentious superiority in this universe. But first we have to achieve Djikstra's dream of finding better solutions to managing complexity in software engineering and category theory could be an answer to that.

3 · January 24, 2014

• ##### Yogesh S.

This should be interesting. Will it be possible to give a general idea? Like category theory etc.

1 · January 6, 2014

### 48 went

• ##### Christine S.
• A former member
• A former member
• A former member
• A former member
• A former member
+1 guest
• A former member
• A former member

### Singapore, Singapore

Founded Nov 27, 2013

#### People in this Meetup are also in:

• ##### Docker Singapore

1,128 Dockers

• ##### Next Money Singapore

2,234 Next Money Members

• ##### AWS User Group Singapore

1,599 Members

• ##### HackerNest Singapore Tech Socials

1,197 technologists

• ##### Singapore Spring User Group

1,736 Members

• ##### Coffee & Psychology Singapore

3,114 Mind Explorers