Functional programming 6.2

The I/O monad

In a purely functional language, such as Haskell, functions cannot have any externally visible side effects. Although a function cannot directly cause a side effect, it can construct a value describing a desired side effect, that the caller should apply at a convenient time. In the Haskell notation, a value of type IO a represents an action that, when performed, produces a value of type a.

We can think of a value of type IO as a function that takes as its argument the current state of the world, and will return a new world where the state has been changed according to the function’s return value. The state created in this way can be passed to another function, thus defining a series of functions which will apply in order as steps of state changes. This process is similar to how a temporal logic represents the passage of time using only declarative propositions.

— Wikipedia on Monad (functional programming)

2012.08.22 Wednesday ACHK

How Not to Die

Idea babies 3

If you look at a list of US cities sorted by population, the number of successful startups per capita varies by orders of magnitude. Somehow it’s as if most places were sprayed with startupicide.

I wondered about this for years. I could see the average town was like a roach motel for startup ambitions: smart, ambitious people went in, but no startups came out. But I was never able to figure out exactly what happened inside the motel — exactly what was killing all the potential startups.

A couple weeks ago I finally figured it out. I was framing the question wrong. The problem is not that most towns kill startups. It’s that death is the default for startups, and most towns don’t save them. Instead of thinking of most places as being sprayed with startupicide, it’s more accurate to think of startups as all being poisoned, and a few places being sprayed with the antidote.

Startups in other places are just doing what startups naturally do: fail. The real question is, what’s saving startups in places like Silicon Valley?

— Why Startup Hubs Work

— October 2011

— Paul Graham

2012.08.22 Wednesday ACHK