Want to keep learning?

This content is taken from the The University of Glasgow's online course, Functional Programming in Haskell: Supercharge Your Coding. Join the course to learn more.

Skip to 0 minutes and 7 secondsJEREMY: Katie, thank you for inviting me to Facebook to meet you and--

Skip to 0 minutes and 11 secondsKATIE: You're welcome.

Skip to 0 minutes and 12 secondsJEREMY: --to see the sights of London. It's great being here. I want you to tell me a little bit, please, about how you got into Haskell programming, where you found out about it, and why you like it so much.

Skip to 0 minutes and 23 secondsKATIE: OK. So I learned about Haskell from a professor at my university. Like most universities, we have that one professor who's really crazy about it.

Skip to 0 minutes and 32 secondsJEREMY: Oh, right. Good.

Skip to 0 minutes and 33 secondsKATIE: But unlike most people, I didn't learn about it in official classes. The classes that included Haskell were unfortunately cut from the curriculum.

Skip to 0 minutes and 40 secondsJEREMY: Oh, how sad.

Skip to 0 minutes and 41 secondsKATIE: And this professor-- very, very sad. This professor was so passionate, he offered to teach interested students in the library in his own time. So we had little secret sessions in the library to learn about functional programming and also logic programming. So he taught about a bit of Scheme, a bit of Prolog, and also some Haskell, and that's how I was first exposed to it.

Skip to 1 minute and 0 secondsJEREMY: Wow, the secret functional society. That's good, isn't it? Haskell is used quite extensively at Facebook, isn't it? Can you tell us a little bit about how you use Haskell in your day-to-day software development?

Skip to 1 minute and 13 secondsKATIE: Yes. I work on a system called Sigma, which is basically a rules engine for catching bad things on the site, things like spam, for example. And it's a C++ Haskell hybrid, but it runs rules that are written in Haskell in EDSL, embedded domain-specific language, called Haxl, which is open source so people can check that out.

Skip to 1 minute and 36 secondsJEREMY: How do you spell Haxl? Sorry.

Skip to 1 minute and 37 secondsKATIE: It's H-A-X-L.

Skip to 1 minute and 38 secondsJEREMY: OK. We'll google it.

Skip to 1 minute and 40 secondsKATIE: Haxl.

Skip to 1 minute and 40 secondsJEREMY: Cool.

Skip to 1 minute and 41 secondsKATIE: And this system runs more than a million queries a second to fight badness on the site. So Haskell is being used in the real world in production to help make Facebook a nicer place.

Skip to 1 minute and 55 secondsJEREMY: And there are lots of people using Haskell at Facebook.

Skip to 1 minute and 58 secondsKATIE: Yeah, not just me. We have dozens of people here who are writing these rules in Haskell and also people that are working on this project, of course, as well.

Skip to 2 minutes and 9 secondsJEREMY: Can you tell us a little bit about the Commercial Users of Functional Programming Conference? You're involved with that, I think, and that's something that showcases functional programming in what you might call the real world, I suppose.

Skip to 2 minutes and 23 secondsKATIE: Yes. And it's been going for quite a number of years now, I think over a decade. So this is run as part of ICFP, the International Conference on Functional Programming, and I've been co-chairing it for this year and the previous year. And we've got some great talks coming up, so if anyone wants to head to Japan.

Skip to 2 minutes and 43 secondsJEREMY: A nice holiday. A nice functional holiday in Japan. Very good. OK.

Skip to 2 minutes and 47 secondsKATIE: But it's at the stage now where it's no longer a niche thing. I think when CUFP started it was people just finding camaraderie in other people having the frustrating experience of trying to get FP into their workplace and trying to make it work and convince their employers. I think we're well past that now.

Skip to 3 minutes and 6 secondsJEREMY: So kind of the battle is almost half won, you're saying already.

Skip to 3 minutes and 10 secondsKATIE: Well, certainly there are lots of big companies like Facebook that people can point to to say, well, why can't we use it at my company? Facebook's using it. And there are other big names. So a lot of that battle is won now. And the event has changed focus as a result of that.

Skip to 3 minutes and 26 secondsJEREMY: On our course, Katie, we're learning about monads. We've looked at Maybe and the IO monad so far. I'd like you to try and convince that monads aren't scary.

Skip to 3 minutes and 39 secondsKATIE: Oh, OK. So why do people even think monads are scary, right? Maybe, firstly, because that have an unfamiliar name-- monad. People probably haven't heard that word before, sure. And also because there's this bit of a cottage industry of writing monad tutorials on the internet, and people think, oh, if it needs all these tutorials, it must be hard. Not true, not true at all. All monads are are basically a pattern. It's the simplest way of explaining what it is.

Skip to 4 minutes and 3 secondsJEREMY: OK.

Skip to 4 minutes and 4 secondsKATIE: Monads are useful, because we believe in the DRY principle as good programmers-- Don't Repeat Yourself. And monads are simply a way of not repeating yourself. It happens to be that there are many quite disparate things actually, as disparate as Maybe and IO and Lists and a number of other things--

Skip to 4 minutes and 23 secondsJEREMY: But we'll come to that next week.

Skip to 4 minutes and 25 secondsKATIE: --yes, yes-- that fit a particular pattern. And that means that you can write code once for all the things that fit that pattern and not repeat yourself. And that's basically it in a nutshell. And monad, of course, is only one of these abstractions that we have in Haskell. There are many others too.

Skip to 4 minutes and 38 secondsJEREMY: OK.

Skip to 4 minutes and 39 secondsKATIE: And they're useful. And that's it. That's really all there is to it.

Skip to 4 minutes and 42 secondsJEREMY: I feel slightly reassured then. Thank you. OK.

Skip to 4 minutes and 44 secondsKATIE: Glad I could be of service.

Skip to 4 minutes and 46 secondsJEREMY: We're going to go into a lot more detail next week. But you've got a great video about monads as superheroes online. Can you ever give us a two-minute pitch of that, and we'll post a YouTube link on our website below.

Skip to 4 minutes and 58 secondsKATIE: OK, sure. First, I should clarify when I say monads are superheroes, I'm not trying to add another analogy--

Skip to 5 minutes and 3 secondsJEREMY: Oh, right.

Skip to 5 minutes and 4 secondsKATIE: --to all the analogies you already see out there about monads, because I believe it's better to go from the concrete and see lots of examples and then build up your own intuition of what the abstraction means. So you're not going to know what monads are just by hearing that they're like superheroes. But in the talk, I basically just talk about what the key aspects of a monad are. So monads are basically-- there's a type class. I understand you've already taught that.

Skip to 5 minutes and 29 secondsJEREMY: Yes.

Skip to 5 minutes and 29 secondsKATIE: So you can say this.

Skip to 5 minutes and 30 secondsJEREMY: Yes.

Skip to 5 minutes and 30 secondsKATIE: A type class that has two-- there's another way to define it with three-- but two or three key functions on it. And it needs to follow some laws, the way that you implement this. That's really the crux of it.

Skip to 5 minutes and 42 secondsJEREMY: OK. More next week.

Skip to 5 minutes and 43 secondsKATIE: Yes, sure. I'm sure you'll go into all the details.

Skip to 5 minutes and 46 secondsJEREMY: We will, yes, excruciatingly. Thank you. Good. If someone on our course came along and said, right, will functional programming make me more employable? What would you say?

Skip to 6 minutes and 2 secondsKATIE: This is a good question. I think that a lot of employers out there are starting to twig to the fact that people who are interested enough in programming to learn something that's not the mainstream paradigm like functional programming tend to be good-quality programmers. So I think, in general, it serves you well to have those skills as part of your toolset. There aren't as many purely functional programming jobs out there as there are other jobs, for sure, but they do exist. And it seems that their numbers are growing. So, yeah, I think it's definitely a benefit to have those skills.

Skip to 6 minutes and 37 secondsMost importantly, though, I think it's great to learn functional programming just to learn how to think in a different way about problems.

Skip to 6 minutes and 43 secondsJEREMY: Yeah. Good. We've been trying to emphasize that on our course. Thinking functionally is a good skill to have, even if you don't use functional languages. Katie, tell us about the big gong that's next to you. What's this for?

Skip to 6 minutes and 55 secondsKATIE: So this is a tradition here, that when you ship something, you get to come and hit the gong so the whole office can hear that something's been shipped.

Skip to 7 minutes and 3 secondsJEREMY: It's quite loud.

Skip to 7 minutes and 4 secondsKATIE: It is. Do you want me to demonstrate?

Skip to 7 minutes and 8 secondsJEREMY: Well, why don't we ship our interview, and you can whack the gong to tell everyone we've done it.

Skip to 7 minutes and 13 secondsKATIE: All right. I don't know how I'm going to explain this one, but sure.

Haskell at Facebook

Jeremy recently visited Facebook’s London office, where he met Katie Ots. She is a software engineer at Facebook, developing Haskell code for real-world applications.

Katie explained how and why Haskell is used at Facebook. She is also well-known for her talk on superhero monads. We will explore monads in more detail next week, but you might also want to check out her talk before then.

Share this video:

This video is from the free online course:

Functional Programming in Haskell: Supercharge Your Coding

The University of Glasgow

Get a taste of this course

Find out what this course is like by previewing some of the course steps before you join: