Menu
Sign In Search Podcasts Libraries Charts People & Topics Add Podcast API Blog Pricing

Simon Peyton Jones

πŸ‘€ Speaker
962 total appearances

Appearances Over Time

Podcast Appearances

The Peterman Pod
Co-Creator of Haskell: Functional Programming, Thinking in Types, Useless Languages | Simon Jones

Something that's very monad-like has appeared lots elsewhere.

The Peterman Pod
Co-Creator of Haskell: Functional Programming, Thinking in Types, Useless Languages | Simon Jones

It's been a very unifying concept.

The Peterman Pod
Co-Creator of Haskell: Functional Programming, Thinking in Types, Useless Languages | Simon Jones

It lets you reject silly programs up front.

The Peterman Pod
Co-Creator of Haskell: Functional Programming, Thinking in Types, Useless Languages | Simon Jones

So if I have a function that adds one to things and I apply it to a character or to an IO computation, I'd like to, that's going to fail at runtime.

The Peterman Pod
Co-Creator of Haskell: Functional Programming, Thinking in Types, Useless Languages | Simon Jones

Because I can't add one to a character.

The Peterman Pod
Co-Creator of Haskell: Functional Programming, Thinking in Types, Useless Languages | Simon Jones

Or maybe you overload plus, maybe reverse a list or something.

The Peterman Pod
Co-Creator of Haskell: Functional Programming, Thinking in Types, Useless Languages | Simon Jones

If I've got a list reverse function and I give it something that just isn't a list, then it's a bit silly to allow that and only fail at runtime.

The Peterman Pod
Co-Creator of Haskell: Functional Programming, Thinking in Types, Useless Languages | Simon Jones

So fundamentally, type systems are about rejecting at compile time, programs that you do not want to run because they will fail at runtime.

The Peterman Pod
Co-Creator of Haskell: Functional Programming, Thinking in Types, Useless Languages | Simon Jones

Now, we've had static type systems for a long time, like going back to Pascal and earlier, but simple type systems are annoying because they get in the way.

The Peterman Pod
Co-Creator of Haskell: Functional Programming, Thinking in Types, Useless Languages | Simon Jones

Imagine a function that reverses a list.

The Peterman Pod
Co-Creator of Haskell: Functional Programming, Thinking in Types, Useless Languages | Simon Jones

In Pascal, you could write a function that reverses a list of integers, but if you wanted to reverse a list of characters, sorry, you can't.

The Peterman Pod
Co-Creator of Haskell: Functional Programming, Thinking in Types, Useless Languages | Simon Jones

That function that reverses a list of integers, it has type list of int to list of int, so you can't apply it to a list of characters.

The Peterman Pod
Co-Creator of Haskell: Functional Programming, Thinking in Types, Useless Languages | Simon Jones

Game over.

The Peterman Pod
Co-Creator of Haskell: Functional Programming, Thinking in Types, Useless Languages | Simon Jones

You have to write another copy of the code with a different type.

The Peterman Pod
Co-Creator of Haskell: Functional Programming, Thinking in Types, Useless Languages | Simon Jones

That's a bit annoying.

The Peterman Pod
Co-Creator of Haskell: Functional Programming, Thinking in Types, Useless Languages | Simon Jones

So what are we going to do?

The Peterman Pod
Co-Creator of Haskell: Functional Programming, Thinking in Types, Useless Languages | Simon Jones

We need polymorphism.

The Peterman Pod
Co-Creator of Haskell: Functional Programming, Thinking in Types, Useless Languages | Simon Jones

We need a more powerful type system.

The Peterman Pod
Co-Creator of Haskell: Functional Programming, Thinking in Types, Useless Languages | Simon Jones

We want to give reverse to type for all A, list of A to list of A. So that up front says I work for any type A. You give me a list of integers?

The Peterman Pod
Co-Creator of Haskell: Functional Programming, Thinking in Types, Useless Languages | Simon Jones

Fine.