What do we do what we do in organizations for decades, the accepted answer out there was, well, we do it to increase shareholder value, there's a whole body of theories, explaining why that was the right and indeed the only goal that organizations should focus on. In our present moment, I think it has become very clear that shareholder value cannot be the only thing we need to get right that organizations can't just leave the work of getting our social and our environmental impact right, we can't just leave that to others. So today, we're going to talk to Tom sake about that Tom sake is the founder and CEO of a company called terror cycle and terror cycle basically focuses on getting this challenge of recycling of using complex waste the right way he works in 21 different countries where he engages with organizations and governments in order to figure out how we better protect our environment how we get our social impact. We have him in conversation with Sunil Prashara Sunil is none other than the president and chief executive officer of PMI the project management Institute. He has been working for years to support and help the more than three million members we have here. And I think this is going to be a fascinating conversation. The topic is transformation for sustainability. I give you Sunil Prashara interviewing Tom sake. Hi there Sunil Prashara here president and CEO of the project management Institute to stay relevant and to grow organizations are looking to generate positive social and environmental impact. Can the C suite solve social causes that plague us today? How can leaders transform their organizations and proactively address social causes in a meaningful and impactful way. In the post COVID world corporations will increasingly need to address issues of sustainability and social impact. People are becoming aware of how to treat our planet and people. Corporations need to take a stand and drive action on social and environmental issues. They care about the carbon footprint diversity and inclusion of their workforce and ethical procurement. Companies are starting to be measured in terms of their net positive impact that they generate besides showing great financial results. We also observed that socially purposeful organizations attract progressive talent. And I'd like to delve a little bit more into this topic. And so let me introduce you to my guest speaker Tom Zaki. He's a founder and CEO of Terra cycle, a global leader in the collection and repurposing of complex waste systems. Terra cycle operates in 21 countries working with some of the largest companies on the planet. Tom and Terra cycle have received hundreds of social and environmental and business awards and recognition from a range of organizations including the United Nations, World Economic Forum, Fortune magazine, Time magazine and the US Chamber of Commerce. And he's also had the time to write four books. So please let me welcome Tom. Hi Tom. How you doing? Hey, pleasure to be here. Thanks for having me. It's lovely. Could you tell us a little bit about yourself and how you got into the business? Yeah, absolutely. So for me, I guess quite literally it all started where I was born. So born in 82 in Budapest. And that's only really relevant to the answer because we're still communists. And in 86 Chernobyl happened and that destabilized the borders and my parents with me and four years old until left as local refugees landed in Germany, then Holland and then finally Canada. When I was seven, I grew up there for all intents and purposes and then went to a university in the United States, which is where I live today. And I mentioned that personal story only because it's a journey from communism to capitalism and during that process I fell in love with entrepreneurship. And even today, even in the context we are living in, I would say business is the most powerful tool for change, even more powerful than disease, war, politics. It's incredible what a CEO can do with the snap of his or her finger. Now, for me at the beginning, I fell in love with entrepreneurship for the selfish trappings, fame and fortune. You know, and luckily to some degree, those have come. But what was the real turning point for me and what led me to start TerraCycle as a purpose or mission driven business. I remember this so clearly the first class I took a Princeton in my freshman year was economics 101 and the first class first lecture first everything. The professor gets up on the stage and asked an incredibly reasonable question to the audience, which is what's the purpose of business. And the answer she was looking for was profit to shareholders. And I really lost a lot of like excitement, because, look, I'm a capitalist, I think profit is critically important, but I would argue that profit is not the reason of being and instead of measure of health. If you're very profitable, you will grow and sustain. And if you're not profitable, you will shrink and go bankrupt. But it's not the reason. The reason should be how does business help society or the planet or both be better and do so in a healthy profitable way. And so that led me on the journey to search for this type of mission driven business context and I fell in love with garbage because it is full of anomalies, you know, in a world where we measure our status in society and no small part with how much, how much stuff we have. Isn't it interesting that only one industry, the garbage industry can say that it will legally own everything you possess one day for how big of a concept that is quite literally the level of innovation is strikingly low. Taking you back to the Princeton time and with your views around, you know, the businesses for profit and properties for shareholders. And you said you had a completely different perspective. How, when you gave that perspective, what was the reaction back then? And how has that changed to where we are today? So it's a really good question.  And I think that the context of profit being the God that everyone served was much more square. And so I think less people resonated with my dissonance. But today, you know, I was just actually giving a talk at Harvard Business School yesterday and I asked the audience that question. And most of them wrote back much more inspiring answers like, you know, stakeholder value, making the world better and all this stuff. And I noticed a measurable shift in not the purpose of business, but what people hope the purpose of businesses. And why I say that it's hope is that most leaders today running companies are still running it with the God of profit at the main God they serve. And then maybe if we can do it a little bit more sustainably or ethically, so be it. Yeah, I think that, you know, one of the things that's really helped focus the mind on a few other ways of how to value companies has been some of the big tectonic shifts that are happening around the globe today, like global warming, like hunger, like, you know, pollution, like you mentioned their waste, etc. How I mean how can business leaders start to solve some of those those those problems because the decision makers they run large organizations. But how do you think that they can be motivated to really sort of focus that organization beyond the profit into these areas. Yeah, I think to do it, we do have to acknowledge right the ecosystem that companies are in and the demands, you know, of leaders by their shareholders and by the stakeholders that are commanding them, you know, so you can't really divorce these motivations when you agree or not agree right. I've met many folks who run, you know, large fortune 500 companies and they say, well, I have a limit on what I can do because if I don't do it while serving, you know, growth and all those sort of traditional goals, I will be replaced by someone else who will. So there is we have to acknowledge that context, but I think we can do it from two perspectives. One is a perspective of stick, you know, like through risk avoidance. And the other is a perspective of innovation and opportunity and growth and I think both come in play simultaneously. Now, by the way, it's really interesting where some companies put their sustainability department. Some companies put it under the legal function. Some companies put it under the communication function and marketing function. Some put it as an independent function. And it's so telling where someone, you know, where an organization puts it, because if they put it under the legal function, they view sustainability as a risk to be managed. While if it's put under, you know, more of a growth type function, like even marketing or something like that, then it's an opportunity to win. So from a risk point of view, you know, I think many people will acknowledge that we are in a time where the planet is in crisis, you know, we are going through a mass extinction. We're in the middle of the effects of climate change and only growing and many, many other examples. And so for just sheer preservation of future profit, we do need to factor in how we are preserving, you know, our ability to operate. And I think that would be the most traditional lens to think of it through. But that is an important lens that anyone, no matter, you know, what you're trying to accomplish should look at it because if the world is unstable, it's not easy to be profitable and grow. But I think it's way more exciting to think of it in how do you leverage being purposeful to innovate and to beat your competition and to bring about the future we want to live in, which is a better sort of, you know, future, better services, better products, but also better is also more sustainable and more in tune with what the planet can support. So I have a question for you. So are organizations then seeing, having a social side to their business, an agenda item, or are they seeing it as a responsibility? And what I mean by that is, is it an agenda? Is it something that they're doing to improve their brand to, you know, attract talent? Or is it truly a responsibility that they feel that they owe to society? Are we at that transition point where in the past it may have been, you know, a tactic, if you like, to improve their brand evaluation, and now it's becoming more of a responsibility and therefore more authentic in its purpose. Well, gosh, it's a really interesting question and my gut would say that all actors in the great game of capitalism are fundamentally selfish actors. Consumers are selfish actors as an individual consumer. I am, you know, we care about convenience, value, features and benefits, and I think organizations are just larger versions of selfish actors. They're going to be focused on things that hurt or benefit them, and it's going to be very much that former, which is the uninspired version, right? It is not necessarily doing it as a responsibility, but viewing it as either mitigate a risk or leverage an opportunity or to some degree, both. What is important is, you know, you said that I think a really important word, which is authenticity, and I think the only way to lean in on purposeful activity is to be authentic about it, right? If you are inauthentic, then that tactic, which is going to be a self benefiting tactic, is not going to land and be as robust and not going to, you know, accomplish the goals. But I don't believe that organizations really are capable, no matter how good or bad they are to do the latter, what you said, be responsible unless the law forces legal responsibility over things. No matter how good the organization is and how good the people are, organizations are still fundamentally built to maximize value, be responsible to their shareholders, and then these things more show up as opportunities and risks. Now they're showing up in bigger velocity and with greater fortitude, so that's why we're seeing a leaning in, right? As the world gets tougher, as you know, the fires rage in Brazil, Australia, the West Coast, as we're in the middle of pestilence and there's more hurricanes than ever before, the risk profile and the opportunity profile get bigger. So that's the leaning in. But I don't, unless the law fundamentally redefines, you know, the responsibility, I don't think you'll ever get to the latter. Yeah, no, I mean, I just take my own example as the CEO of PMI because of COVID. I mean, my first, you know, obviously the first thing I had to think about was what does this mean for the health and safety of the employees. And then secondly, it was, you know, how do I make sure that my organization, my association is sustainable. And then the third thing was okay, you know, obviously we're a four purpose organization, we're not a profit. And a great deal of our efforts go into giving back, you know, but that became sort of, you know, I first of all had to make sure that we were sustainable. There's no point in focusing on giving back if you yourself are not sustainable because you'll only be able to give back until such time as you're not sustainable anymore. And then, and then you can't give anymore.  So I could, I totally understand why where the motivations would be. And in fact, if you look at the way organizations have been structured, since they ever were created, it's always been around, you know, the creation of a P&L and a balance sheet and a cash flow, etc. It's always been financial. And now I think what Kobe's bringing to the table is, there's a lot of value that's not captured in the in the in your own values as a business and what you stand for, especially when it comes to social societal impact, you know, so I think, when it comes to attracting talent when it comes to being associated with a particular company that does something that you personally feel strongly about in the social world is going to attract the right kind of people for your organization. So this is becoming so visible right now.  And I think that, you know, as a senior executive, it's quite a challenge because if your organization has not been focused for a long time or ever in this kind of area, you know, it's a big change. And you're left with with with decisions that you have to make which could be revenue generating or profit generating or you could be saying actually no I'm going to actually contribute towards a social responsibility. So as a senior leader, how do you think that leaders can can help their organizations make that pivot and make that change to a more balanced approach for their operations. Absolutely. And I want to just sort of double click if I man something that you show is really important. Just now, which is purpose is a quantifiable value. Right. If you are purposeful by what you know what you gave as an example of like really focusing and taking care of people, you know, in a time of pandemic, or, you know, many other ways that organizations can be purposeful. Right. There's a huge host of these things, especially now. And I think growing every day is that big difference between today and 20 years ago is that that is showing up even more in quantifiable value. Examples could be recruiting talent is a wonderful one, you know, talent today is much more focused on what the job is and do they feel purposeful doing it and then salary is more can I sustain my state or the living versus historically was a little bit more. What is my salary and then by the way, do I enjoy the job but that's a secondary question. How do I feel purposeful about the job so it's a huge tool, monstrous tool and recruiting talent, open doors and giving access for organizations. Well above their sort of weight class, let's say, generating huge amounts of media attention.  This company went public wonderful organization when public at 88 million and revenue 30 million and loss and is today trading at a market cap of about 10 billion give or take. And that is entirely 100% linked to the purpose it commands in that example of, you know, stopping to eat our protein through animals and instead through plants. So this is getting more and more quantifiable doesn't quite show up on a P&L like brand value, right, but it is just as valuable as the value of a logo or an equity or a slow. So now to your question, if I may, you know, while it may sound cynical, you know, what I was saying earlier that that you know the way decisions are made. And I think it's important that we understand the rules of the metaphorical chessboard, and then wield those rules to create the best possible outcome, versus necessarily get down and bothered that, you know, companies are profit driven, versus, you know, driven to be fundamentally responsible to other things than maybe they're shareholders. So the best way to communicate this for leaders, I think whether you are an external stakeholder trying to influence a company or an external or internal leader trying to move your organization is to frame leaning in on purpose on why it's going to benefit those very basic key performance indicators like profit growth, like market share game, like talent recruitment, because the more you can frame it there, the more your organization is going to understand it and the more they're going to want to lean in. I'll give a couple of examples on this.  And we brought it to the leading companies in the space. They viewed it as well. That's a wonderful thing, you know, but the more we collect diapers and recycle them, the more cost we're going to incur. And, you know, that challenge, right, so the best we could get out of there is maybe some money for a symbolic pilot. But then when we've reframed it on here's how investing in diaper recycling can drive market share, because people will prefer your brand over the competitive brand and retailers will, you know, help promote your brand more than the others. Then they suddenly saw it as wait a minute, I can win in my classic KPIs through purpose. Absolutely I would rather do that than benign activities like buying TV commercial, which don't help the world in any way but accomplish the same outcome. And a good indicator of this is if the stakeholder that you are trying to convince if you're a leader trying to convince your team or if you're an external trying to convince an organization any form and we're always trying to convince no matter whether we run the company or not. If the if the reason to do the purposeful activity is because it's the right thing to do, you if that's the feedback you get, which could be very common and purposeful, you know, things, it's a failure on showing all the ways that that purposeful activity can create value. It's actually a bad thing. We even teach our sales team if the client tells you we're only going to do this platform on recycling or reuse because the right thing to do, you haven't succeeded. And while you may get a program, it's going to stay small and may not last a long time. When instead you want those ideas that you that you so to become seeds that then expand globally in in velocity and volume and then can survive any stakeholder who may control it later, even if that stakeholder is very traditional PNL focused and not seeing the light on purpose just yet. How do I mean fantastic and you know a lot of topics there that you covered I'd love to double click on.  And now as the world starts to pivot, pretty much in the direction that what you've been advocating in for a long, long time, you know, you see yourself in a in a space where actually you can make an even bigger difference. I'd love you to just tell me a little bit more about your story about TerraCycle and what it does and how it's grown to become, you know, a stand up case for sustainability. Absolutely. Also, you know, I'll go back to to those those early days at university where I was now on a search for a purposeful business model. And, you know, to be very honest, the sort of genesis of our company was as a fertilizer company we were taking organic waste feeding it to worms taking the worm droppings or work with liquefying it. And then putting that in new soda bottles and selling that to the likes of Walmart Home Depot target like a consumer product company. Again, I fell in love with this idea of waste, because of all the strange anomalies. It's a massive industry, but because we're sort of repulsed by waste in all forms. It has incredibly low innovation relative to how big it is and how much how literally all of our stuff one day transfers through the ownership of a waste management company and literally with no exception. This is the only commodity in the world that hasn't high demand, but negative value. In other words, people are willing to pay you to take, take it. So there's all these amazing anomalies that got me really excited. Now, technically TerraCycle started effectively as a fertilizer company and I left school and over the first four years, you know, we built it into a multimillion dollar sort of work group company. We shipped about four or five years in where, you know, we asked ourselves, by making the product out of garbage, are we going to actually accomplish our mission, which is to eliminate the idea of ways like fundamentally solve for ways that's our big very idea. And we realize that we can't because if you make the product of business hero then you're going to even if it's technically made from wasting to pick the very best ways to make it you know certain organic waste that would feed the worms and certain ones we wouldn't or you know even if it's you use soda balls it was the best of you soda balls. And so net net. We ended up completely pivoting the company to what it is today, and we made waste the hero of the business. And so if you break apart TerraCycle it has three major divisions, and then some emerging ones, the first focuses on the collection or recycling of those products and packages that today you recycle new local recycling then everything from cigarette butts to dirty diapers to face masks and gloves and thousands of waste streams. And what really makes something not recyclable that it's not economic to. So we get stakeholders to be brands retailer cities to fund the actual cost of collecting and processing a certain waste stream. And then we show them how they can traditionally when that goes back to that sort of traditional value generation. Our second division and focus on how do we integrate waste back in the products like ocean plastic into shampoo bottles or hundreds of other such examples are third division under the brand loop which is relatively new is all about shifting from single use consumption to reusable consumption so imagine you're hugging dust ice cream is now in the usable stainless steel or your cascade dish soap is in glass and so on and so forth.   Absolutely so I mean we've been recycling PPE you know for almost a decade but primarily through back end you know supply chains so you know plastic gloves from airports or personal protective equipment from manufacturing facilities. What COVID has done is really brought PPE consumption to the consumer because people usually other than Asia perhaps people haven't been wearing face masks or really protecting themselves in this way. And it's an explosion of this overall material some statistics so that during COVID we have increased our waste by 30% per capita. That's not just face mask money it's take away food packaging it's more cleaning agents it's more right and it just goes on and on. And so we have seen an objectively a major increase in that sort of category of waste.  It's ironic here in COVID because you know the positive out of it is that it's the first time in our modern history that we have taken the foot off the gas in it you know in production on a global basis, as well as for a sustained period of time that's never happened, never ever happened like that. And what is the world done breathed a little better quite literally which is ironic because a respiratory disease allows the earth to breathe, but emissions are down. Objectively smog is down I mean literally the earth is breathing better and animals are going back to habitat they weren't in before there's all this amazing stuff. But on the other side, and this is actually giving tailwind mind due to the environmental movement, individual citizens out there are measurably more concerned about the environment because of code. Yeah, I would agree and you know I've seen that here in London to that you know incredible changes in in in wildlife that's out there you can hear birds all of a sudden you know it up from all over the place and you know we had dear the other day outside my place and incredible. I can't help feel that this just could be temporary I mean we're going to find a solution for for COVID. It may take a year, it may take two but at some point in time we'll kind of like go back to the pre COVID world which was very much focused on growth financial growth and wealth and you know, extraction of natural resources and whatnot and voice a very loud one, saying be careful what you do. I mean people were still moving on, really not really taking it as serious because it's creeping up on you slowly it's not like a shock like what what COVID was and so once organizations may recover from this.  Yes, and I mean let's be clear. We haven't left yet. I mean we just slowed it down a little bit. We are still day to day doing exactly you know what what you've described, and I do see that right and the longer I've been doing the work, you know, the more sort of cynical I become a little bit progressively on can we solve this or are we really going to do it voluntarily before we're really forced to do it was an interesting sort of piece. Talking to a reporter last week and we were talking about this idea of circular economy, you know, moving from linear systems where you know products are waste to circular ones where the products can go around and be either recycled or reused but he absolutely had a question he goes you know but what about intrinsic sustainability like fundamentally in balance with the earth. Can we get there. And you know the the after thinking about it my answer was, it's not can we will there's no question, the earth will be an intrinsic balance at some point in the future. The only question is, are we going to make it as a species, the human species, the rest of the plants and animals some of them will survive but generally, you know, Florida fauna will survive us, and, and or will we be battered and brews or will we be there happily. And that I think is the real question for us, because the earth has mechanisms to put everything into balance now we don't have predators anymore we've killed them all, but it does have disease, you know, it does have natural strain on the environment, more extreme climate. And so we will get there. The question is how much challenge, are we going to have to go through, and will we survive it. The, the interesting sort of data on this is that any country after it experiences environmental atrocity Fukushima in Japan, Australia burning down, you know, and many other such examples, the people in that country index up always on the concern for the environment. And even when it stabilizes their net more concerned for and it's maintained there than they were before. But isn't it interesting that it requires such stress events to do that. And then the question that I don't know the answer to this part is the relative stress versus the actual improvement. You know, and how much are we, are we improving every time we get to the punch in the face in an environmental fashion. And a lot of these sort of, you know, challenges are happening, but we're not actually feeling the negative effects, you know, we're in the middle, objectively, we're not feeling the mass extinction. But I don't think any of us actually feed it, you know, sorry, I said needed because our plates are still had exotic food on them. We're not feeling the negatives. Those are probably going to be long cycle negatives, you know, where the, the, all that diversity loss is going to come back to us, but it may not come back in a lifetime, it may take a little longer. And so there is optimism, you know, there. And I think we, I don't know business to your question can actually solve it because what is the big issue and all of this is that we are gorging ourselves on consuming things. And when you consume your voting for in some form of straining the planet, even the most organic fair trade reusable form of consumption is a vote for stress on the environment because whatever even at that farm was the best iodynamic farm in the world that could have been a force. That I think is the bigger question, but I wonder if business is actually able to do that because it's business able to, you know, focus on the growth or restraining itself. I don't know if it's possible. I don't know. I think that was something that you said earlier, you know, if you're going to build a road, right, you know that some people are going to speed and you know that there's going to be maybe some accidents on it. And so that doesn't stop you from building the road. Right. And you may have to put some, some, you know, gateposts guardrails, you know, laws in place to ensure that people stay on the road and stay safely. And I think that you mentioned earlier that, you know, maybe this has to be a change in the law, and maybe organizations need some kind of direction because you're right. You know, if you think that the ramifications of some of the current sort of behaviors of pre COVID world are not going to manifest until, you know, 10 years, 15 years from now, then a lot of people in their businesses are going to say, Well, you know, it's not going to impact me now. And I'll let the other person deal with it next time when it comes. And by the way, I just can't see, you know, some significant impacts to my organization. I just crack on the way we're going. And the problem with that is it's complacent. And whilst people know, and this is the surprising thing, you have all sorts of documentaries, all sorts of activities going on all around the world saying there's global warming, there's pollution, you know, there's mass extinction, overfishing, etc. People see that they almost become punch drunk and say, Yeah, I'll get all of that, but I'll carry on and do my annual, you know, financial performance year on year on year on year and eventually we'll deal with it when it happens. The thing with COVID though, was it, whilst people knew it was happening, they didn't realize it would move at the pace that it did and they didn't realize it was going to be such a shock to the system, and especially the economic world. And so therefore, organizations are immediately having to think how do I stand myself back up again. If you look at the retail sector and you look at the airline sector, it's a real trouble right now, really trying to identify what are they going to be laying people off, you know, and realizing or even understanding whether they may, whether they'll have a business in five years time from now. So big, big changes. My concern is that without law, and some changes in the law that says that we say that we have to be ambidextrous as businesses that not only look after the financials of the business per se, but we have a moral duty and responsibility for the planet and our people. Unless we have that, you know, almost kind of like set in stone, it's very difficult to visit your world where, you know, everyone unilaterally are conscious on this. I mean, I'd love to hear your views. I mean, do you agree that the government may a big part? I think you are absolutely, absolutely right. I think the idea we have to set up some so either the environment is going to painfully control us and that will not be pleasant. There is no pleasant form of the earth pushing back, right, it is intrinsically unpleasant, not just to us, but to a lot of other fellow sort of travelers on the spaceship of birth, right. So, so that is one form of guardrail that will 100% come, but we will really not enjoy it, or we have to put up our own guardrails. And this is the role of civil society, you know, as citizens, not as consumers to voice our, you know, these things to vote in politicians who will then action those with laws, and, and to vote with what we buy for the future we want. And that here's the important macro sort of punchline within all of that is that we do need to vote for a smaller net appetite. Right today, you know, as I mentioned to you earlier, you know, when I first got into entrepreneurship, I've gone into it for fame and fortune for completely selfish reasons, right.  You know, how much that is intrinsic in our world, right, how many of our talented young people want to be bankers. Absolutely. It is unbelievable, you know, like in that same business school class I asked students how many of you want to be bankers 30% of their hands were put up, not to say banking is bad, but it's, it's not the same, right. It's, you know, it's really their motivation is financial personal gain, right. That's why they, you know, it's a very lucrative employment. And it's a definition of success, right. At that age, it's a definition of success. The first person who can get to the flashiest car amongst their peers. That's what people are looking for at that age. And I think that having said that, though, it's the same age now that's looking back and saying, you know, hang on a minute, our parents and parents parents have been very decadent and very irresponsible. And they are the community that probably will be able to, you know, make it make a change and have that mind shift. But I think it does take a mind shift. And it does. And I do think that it needs to be supplemented and complimented in the initial stages with policy and with some some degree of governance. I think that will that will help trigger motivate in the right or incentivize if you like in the in the right direction to create balance in the world. I love your point where you're saying they will reach a point a tipping point, actually a dangerous point, which is where there's the equilibrium between usage and and and waste and sustainability. It's better to be on the right side of that. They're on the wrong side, which is where we seem to be right now. Right. I want to finish off with a question which I'm really interested to hear your perspective on. I'd really like to know over the next five, 10 years, how do you see organizations develop recognizing this change in mindset, recognizing that that change in mindset needs to be pervasive around, you know, creating a social responsibility, not a social agenda, being responsible for the organization's not only financial wealth, but the people that work in the organization and the, you know, the carbon footprint of your like or the social responsibility. 10 years from now, five years from now, how do you see that going.  And so what, when I don't think we're going to be able to change fundamentally some of these macro topics that we've been speaking. So I think, you know, what we would really, what I hope is that leaders can see clearly just how traditionally powerful the idea of purposes and purpose in taking care of people, taking care of planning, and any, you know, combination therein, and that it can be something that can really propel the organization within the traditional context, because I don't think the traditional context in a change in that period of time. But what can change is instead of winning with unpurposeful activities that you change and win with purpose. And I think that is something that we're already seeing. There's brilliant case studies of it. And it's only getting more and more.  And I think if we can do that, it may give us runway to have the more challenging discussions that you were just mentioning on policy on maybe changing our sort of point of view from a society, and not just putting on a pedestal, to this idea of accumulated stuff in that we the only answer is going to be how do we shrink our appetite, which is going to force us to redefine a lot of different things, you know, like business today has an appetite for infinite growth. Not sustainable in a finite place. And so we I think we need to do what we, you know, the short term solutions that we give ourselves runway to have the more challenging and difficult business redefinition and policy discussions to get us to somewhere where we happily get into a balance with the earth and not in a very unpleasant fashion. Yeah, that's a fantastic answer. I mean, I look forward to that day when that happens. I do agree with you, it's going to take more than five years to make that happen. But I do think also that the whole world really is shifted in that direction. And I think there is a lot of purpose now, and a lot of recognition across the globe and at all different levels and different ages that this is important, a very, very important issue. A lot of financial institutions are looking at the way they evaluate organizations. I've seen that myself with some of the organizations we deal with when they look at evaluating organizations, they bring in the social, the social responsibilities as part of the evaluation of the economy. And that's one step forward in, in going beyond just the economic value, the financial value of an organization and also youth have choice talent has choice about where it needs where it would like to work. And so when you have a certain kind of social responsibility. And we know that the youth are looking at this and say this is our future world that we're talking about. They're very selective over the type of organizations they work for and therefore that's also an added incentive for organizations and businesses and senior leaders to think about how they're setting up their organizations for the future. Tom it's been wonderful to talk to I love the point about balance I love the talk at your, your, your, your growth in your business and what you do for for the communities around the world. Thank you so much for your time. Much appreciated. Thank you it's been such a pleasure to chat with you. A big thanks to Tom sake and Sunil for shower for that conversation. I knew that we were wasteful creatures, but that number of 30% more waste during COVID that that's insane, but you can clearly see the need here for smart people to think about how we can transform that aspect of our existence. We are now going to have a slightly longer break. That's about 30 minutes where you again you can explore on the different offerings on the platform here, and then we're going to meet back here on the hour for a panel discussion of an area that everybody now realizes the true importance of namely healthcare. So see you back here in the main stage in roughly half an hour. Looking forward to


Hi, everyone. How's everyone doing? Good. So today, I'm going to talk about lazy functional state threads. It's a paper written in 1994, so about over 20 years ago. And it talks about writing imperative programs in Haskell. And yeah, I think it's a really interesting paper, because I'll get into it at the right time. Yes. So sometimes in Haskell, we want to do strict, stateful computations.  So how do you do strict computations in Haskell? And why would you want to? Sometimes you want to do strict computations in Haskell. Why? Because of reasons.  Like when you do a graph algorithm, the union find, which involves iteratively updating mutable states. Sometimes you want to do things with hash tables. Mutable hash tables are like a pretty fast data structure. And sometimes you just want performance. Sometimes you really like, and you want performance because the way Haskell thinks about things is different from the way the underlying hardware works. And the closer you are to the underlying hardware, the better performance you can get. So sometimes you do want to write strict, stateful things in a lazy functional programming language. So how do we do that? So in this paper, the authors introduced the notion of a state transformer. And they're like, hey, it's a box. Just think of it as a box. Put some state in, you get some state out, and you get some result. Like just a box. Let's not think about what's inside the box right now. So this generalizes really nicely to multiple inputs and outputs. So you can have more than one input, and you can have more than one output because Haskell has tuples. Again, you put some state in, some inputs, and you some state out in some results. So how do we start implementing this interface? So we have this interface. How do we encode it in Haskell? So we begin with a really simple function called return ST, which what it does is it takes something and it puts it inside this box, this STS box. That's a return ST. And then let's have a then ST. And a then ST is a way of taking one box and another box and putting them together so that the state goes from the first box into the second box out and you get your result. So if you've done much Haskell, these functions, these type signatures might start to look a bit familiar. They might seem to start to match a pattern that we're familiar with. And this is the pattern. So at the time that this paper was written, if you look at it, this idea of this type class and the do notation hadn't made its way into Haskell language just yet. So the code examples that are in the paper are very much not in that style. They look kind of not great. And I've taken the liberty of, in this presentation, translating them to use do notation, which is really handy. So if you, again, in the paper, they go, hey, sometimes you don't really care about the output value at all. Sorry, we don't care about the first value at all. So let's define a then ST. And they call it the then ST in the paper. But again, if you've done much Haskell, you're familiar with it as the, I don't even know what this is called. It's like a bind, but it throws away the first thing. And later, when they start talking about arrays, which I'll get back to a bit later, they talk about a seek ST, which takes a list of actions and completely throws them away. It doesn't really care about what happens next. And in Haskell, we know this as sequence underscore. The underscore, like, it indicates, again, we're doing this for the side effects, not the initial value. So anyway, so we have a bunch of combinators here. We have then ST, seek ST, return ST. So now that we've done that, we can start talking about references. So let's say we have these, this API. We have return ST, we have then ST. And we have these things. And let's say, now we want to start talking about references because we actually really want variables.  And giving a name to a thing is really useful. It allows us to, like, work with it, pass it around, mutate it, keep track of a thing. Because you can't, yeah, you can't do those things unless you give it a name. So what's an API for giving a thing a name? Let's start with this one. So we have a way of creating a new variable which takes some value and gives you a variable reference to that value. A way of reading the value inside a variable and a way of writing the value to the variable. So this is how you do it. Again, in the paper, this is like the old, this is the way that they use dynasty everywhere in CKST. But if we translate it, it looks a lot nicer. It looks like that. Yeah, pretty simple. Read a variable, read another variable, swap the two variables. Sweet. Great. So now we get to the, I think, the main contribution of this paper, the whole reason that this paper was written. And it's like, okay, suppose we have this thing. How do we get it to work exactly? How do we define... So let's say we have a function called runST that actually runs the box that makes things happen. Suppose we defined it like this. This is an incorrect implementation. Why is it an incorrect implementation? It's an incorrect implementation because you can do something like create a new variable and get... So this is the variable. And then read the variable in two different state threads. And that's wrong. You don't want to be able to share a state between two different invocations. Why do you want to be able to share a state between two invocations? Because things change in the meantime. That's a broken. So how do we make this work? And we use the touch system. Again, if you've done my task, this is sounding familiar. Use the touch system to do a whole lot of things. And it turns out that this is one of them. So the way that the incorrect implementation works is that it basically goes for all s and for all a write a function that takes an STSA to an a. And we say, no, that's not actually right. What's actually right is we want a function that for all a, like, rank to polymorphism. So we, and again, this is, my understanding of this is a little bit hazy. But you get, you want a function that works for any state that is passed to it. So, like, you want to create something that for any a and for any possible state that is passed to it inside the scope, give me back an a. So why does this work? Because if we go back to the broken program, this won't work. We won't have, sorry, we won't have an STSA at the end of it. We won't have a, we won't have a mutable variable of s, because the s is given a value. So one way that I like to think of this is that this is, the s here is like a, is like a beton in a relay. So when you're running a relay, you get a beton. And when it's your, someone else has turned around the relay, you give them the beton. And the beton itself doesn't matter. And we don't really care about what the beton is, right? We don't really care about the shape of the beton, the size of the beton, the properties of the beton. We just care that we have a beton. So it's a token. It's basically a token that is passed from one function or like one box to another box. And we don't really care about what it is, but we can't like take someone else's beton or we can't take a beton that we, you know, prepared earlier and expect it to work. And that's essentially the way that this works. So assuming that you understand that, you move on to array references. And those are also like relatively simple. We parametrize over the index, which is basically any element that has a notion of like, you know, you can use to index something. So we have a new array that takes some bounds. It takes the type of the element and it gives us a rare reference of that type. We have read, write, and this is an interesting one because we basically take a mutable array. We somehow freeze it, make it return an immutable copy of the array and return it back. That's fine. So here's an example of making it work. This is actually fairly complicated, I find. Acumery function that basically runs through, kind of does like a fold. So it takes a, yeah, folds and it takes some bounds and it like sequentially applies. Like it's kind of like a scan, I think, is how I describe it. Again, if you're familiar with Haskell. So you have, anyway, this function, you can use it to make a histogram of stuff and you can use it to like sort, to like put an array into bins, to like bins based on some property. Okay, so anyway, so we've covered references, we've covered arrays. Let's start with input and output. Big kahuna. So input and output is essentially, again, one way of thinking about it is it's ST, it's specialized to the type of the real world. And real world here, again, is a placeholder for the world.  Okay, great. Let's give us, let's do an example. So this, again, we go back to the CKST that I mentioned earlier. You can, using this type, you can define a put char, if you have a put char and a get char, you can define a put string. Makes sense. So the way this actually works is that they say, hey, let's do something cool. Let's introduce a C call primitive. So like language feature that interfaces to C. So we have that. Suppose we have that built in. We can actually define put char and get char in terms of C call. Okay. It's pretty straightforward. And let's do something like the main function in, sorry, the main, yeah, the main function in a C program. Let's have a main IO that is the only thing that is the equivalent of run ST. So, okay. So if you're following along with the paper, which I feel like no one is, which is fine, which is great. There's a part of this that I completely skipped, which is the formalization. And I think that's because it doesn't really add to the understanding of the paper to me. It basically goes, hey, let's take a lambda calculus. Let's extend it with run ST and C call. And let's prove that everything kind of works. It fits together. Let's, yeah. Yes. Actually, as far as I know, they didn't in the original paper prove that this kind of type trickery is enough. That's right. That's a good point. Prove the safety. Yep. And like a couple months ago, paper which does prove that. Yeah. Yeah, thanks. That's a good, yeah. Thanks for mentioning that. That's right. They do mention that the part where they actually, actually they formalize the language, simply type lambda calculus extended with C call and run ST. But they stop short of saying that run ST itself is correct. And they say that we presented an informal argument. We think it's right. We haven't just haven't done it. And recently, yeah, there was someone who was like, hey, you can actually formalize it. And anyway, so anyway, implementation. So crucial to the implementation is the idea of updating things in place.  It's probably not going to be fast. So they have an informal argument, basically boils down to, hey, state is single-threaded, state is strict. Our run ST function is, as we mentioned in the type, parametrized over any possible input state we could pass it. So in place updates are fine. They're correct. It's all good. And again, as Gurgi mentioned, it's not, yeah, you don't have to implement the, yeah, that recently they finally proved that it is in fact correct. And let's talk about efficiency. So in Haskell, we have the state type. And if you've tried to implement the state type or looked at how it's implemented, this will look relatively familiar. This is a way of, this is essentially the state type, except for this current state thing. And as I mentioned, the current state thing is like a beton or a token, depending on how you want to think about it. And its actual value doesn't matter. Which is what they say as well. You can just give it anything. But the fact is, because of the way that this is defined, the current state is passed from one to the other to the other, like a beton, exactly like a beton. And that's what ensures that things happen in a sequential order. So that's what they mean by threading, right? This is where the word thread comes from, in the title.  But we have state and it's threaded state, single threaded. So if we define it like this, the advantage of defining it this way as opposed to some other way is that you can do a transformation. You can basically take some code that looks relatively straightforward. You can inline it to get to that. And then once you inline it to get to that, you can transform it to go stricter. You can form a strictness transformation to make it go, again, to transform it and like ensure strictness. And then by the time it gets to the code generator, you can even throw away the state. Because as we've mentioned, the state doesn't really matter. And so now we get into the nitty-gritty of Haskell.  And those are necessarily strict. And they're kind of denoted as like primitives with like a magic hash. I think that's the name of the language extension that allows you to use them. So there's a magic hash. So if you go back to the state thing, this is very similar to the state type definition, except that we use these unboxed values. And that's how we use them to define our, like our API for references, for example, like NuBar. And they make a special point of saying that, hey, freeze array naively implemented might not be so efficient because you're always like freezing it and like throwing away the mutable array. Sorry, throwing away the mutable array and giving them back the immutable array. But if you know that the mutable array is not going to be used in the future, you can just give them back the mutable array and it'll be fine. So the difference, so IO is implemented very similarly to that type, except for the fact that there's a case here instead of a let. And this means that, and case in Haskell is one of the, means that it's going to be strict. And we know that it can be strict because it updates in place. And we know that we need to update in place because the real world is something that always needs to be updated in place. The only reason you'd want to do something to the real world is because you want it to update in place. And then they define some more stuff. They go, hey, it turns out it's useful to define whether two variables are equal, two references are equal, and two arrays are equal. And they also do something that actually kind of, yeah, I think this is a step too far personally because this is one of the things that's useful in Haskell, but it's also really dangerous. And I actually mentioned this. They say, hey, everything so far uses the state only once. And you're like, yeah, there's no duplication. There's no like not using it. We always give it back except for honesty. But this is one of the things I say, hey, what happens if we actually relax the assumption? What happens if we duplicate the state? So then we are able to reintroduce laziness into our strict state threads. And that gives us things that I think this is very similar to the way things actually work in Haskell. So you have a lazy read file. But they say that this is a really dangerous function because we can't prove, like we don't prove and we don't even try to prove that what you're doing is safe. And this is a burden that we place on the programmer. The programmer when using this function has a burden of proof. And this is something that has gone largely unheeded by Haskell programmers for like almost 25 years now. So I think that's pretty funny, but also a bit scary. So in conclusion, have we turned Haskell into C? In a subsequent, sorry, this is in a follow-up paper to this that actually the authors asked the same question. Hey, has the purpose of this whole exercise been to turn Haskell into C? And they say, no, it's not because we're still able to separate the pure parts of a program from the impure parts of a program. And we're still able to iteratively go, hey, this thing might work better as a pure function and turn things, transform things as necessary from impure computations to pure computations and kind of peel away the layers of the program such that we expose the, I guess, the imperative core, the imperative spine of the program is how I like to think of it. And the rest of it that is purely functional. And yeah, so this is the reason that I really like this paper and I thought this was worth presenting is because in Haskell, Haskell has a bit of a reputation of being to ivory tower. People don't really care about the real world. And I think this is a paper that demonstrates that that is not the case. Over 20 years ago, over 20 years ago, people were thinking about, hey, let's make Haskell fast in performance and let it compete with the big boys. And it turns out that in most cases, you can get performance that is within an order of magnitude of C, which I think is really good. And I think that's all I have for you today. Thanks. So if you'd like, I can show you the code in Haskell itself that implements this paper. And I forgot to mention that. So another reason that I like this paper is that if you write Haskell, you're using the ideas in this paper. This paper's impact on Haskell itself has been quite profound because this is the way Haskell actually works. It has an SD type. It has an IO type. The details are a little bit different. The names might be a little bit different, but essentially it's the same paper. It's the paper as code. And that's really cool. So in fact, if you'd like, you can look at the Haskell source or I can show you the Haskell source and I can, I guess, confirm that it does actually work the way I say it does. I just think it's worth mentioning that one big shortcoming of the SD approach is that you need higher ranked types to be able to type run SD. And if you have higher ranked types, then typing inference is no longer decidable. Interesting. I wasn't aware of that. It basically means that you will have to add some manual type annotations here and there. I think... And one particular in SD consequence of this is that the dollar operator, which I think you've used... I do use, yes. And it's very natural to try to write run SD, dollar... Something. Something. So that would not type check. Interesting. Oh, for a special case? Special case in the type checker. Which is horrible, right? Because... Yeah. Dollar should be... It should be treated the same as... Yeah. Actually, in the paper, they say that we don't actually need higher ranked types in the language. What they do is that they want a special case run SD. They say, hey, run SD should be treated as though it has this type without actually giving it this type. So that's a way that they try to reconcile having simple time inference. But reality, we do have higher ranked types. Yes. So... Yeah, so... Yeah. Anything else? Could you go back to the issue about the run SD implementation being wrong and then there is the type signature? Oh, yeah, of course. There we go. Could you run through that again? Yes. Okay, let me see if I can refer to the paper this time. Okay. So... So... This is equivalent to saying, like, for all S, for all A, SDS goes to A. So it says that... Yeah, so the type itself, like, think of it as like the type is being on the outside. The type is on the outside of this function. Basically, it's like the scope of it is like essentially outside of that part of the function. Whereas the correct implementation says the A is on the outside of the function but the S is inside the function. So the S is like scoped in here which means that the S cannot leak out of this part of the function. So I think the literature refers to it as... Yeah. So if you go back to the previous slide. So in this case, right, your enemy gets to choose S and A, right? Yes. And if I'm a particularly nasty enemy, I will say that, okay, for S, I'm going to choose whatever, S. And for A, I'm going to choose S-T-Rab, S-Steam. All right? I can do that because I get free choice over both S and A. But if I choose that, then that means you now have to give me S-T-Rab, S-Steam which is exactly what you want to avoid because now you have given me... You're leaking state essentially. Oh, I see. A is S-T-Rab. In pure code. Yeah. So I mean, another way of looking at it is that the S never goes outside the parentheses. So the S doesn't escape the scope. So run S-T... In this case, you get to choose the S, right? I, your enemy, you get to choose the A, but then you get to choose the S. Yep. So going back to the example... Yeah, let's look at an example here. Yeah, so exactly as he said. So if you had to choose both the S and the A, then you have a new var... So on the outside, you get a variable and a state. So the state has leaked out of your function, right? Because the V contains the state of it. Yeah, yeah, V contains the state. Yeah, so it's a, like, a mute var of S, A. Whereas we don't, like... Yeah, because A is this type. So anyway, so the point is that your state has leaked out of this function. So let's look at the example again. Yep. As in the state is not in only the first expression, but it's also in the second one. Is that why you say it's leaked out? Well, yeah.  What you get out is a mutable variable of... Actually, no, you don't get a mutable variable. You get an S and an A. You get both the state back. Right? You get a state. You get a variable containing a state and a value. Okay. Right? Because, sorry, if I can go back to my... Yeah. If I can go back to that. A new var goes from an A to an STS mutable var SA. Right? So if my A is... Sorry, if my A is the... Is itself a mutable variable, then the thing that I get back and what run st does is that it takes this and removes the run st bit. Right? So if my A is itself a mutable variable, then instead of the S just being here, the S is there as well. Like, does... You know what I mean? It's like the state has been duplicated, basically. But it's a different S. No, it's the same S. Same S. It's the same S. But the thing is because of the way the... Because the function is... Because the type signature is wrong, I can feed that back into this and I have the state that has been duplicated. Okay. Whereas correctly, if I were to do this and I were to go back to that old example, I would get some S, but it's an S that... Yeah, again, it's not... It doesn't... My mutable variable won't work for any S. It'll work for an S, for one S, but not any S. So in this, you will get... So if you fix it, this line will work, but this line will not work. This line will say, hey, there's already an S here. I can't do... You know, this doesn't work. This doesn't type check. So, yeah, ranked to polymorphism or the appearance of ranked to polymorphism, which is what it means when the for all is in here instead of on the outside, means that the runST function will work. Yes. So the example program won't given this correct category? No, no, no. So this line won't type check. This line will work, but this line will not. No, but the other... Is it the other way? Yeah, of course, because the first one is the one that tries to return... I mean, yeah, the first one is the one that tries to return the variable. Okay. So the idea, right, is that this S is just the type level of tag. It's just a label you attach to various universes of preferences. And you want to avoid crossfalls between universes, right? And when you say that you have something which can run in any S, it's like a kind of translation of the various, because you can say that if you start in any of these universes, you can do something which is locally consistent, right? If you can do that, that means you can't possibly have any crossfalls with other universes, because if you had, then you wouldn't be translationally variant. You wouldn't be able to be moved from one universe to the other, because then your references to those other universes would break. So this is how the higher rank type ensures that whatever A you return is self-contained in the sense of not having any references to anything which depends on the choice of S, right? But again, S doesn't exist. It's not, you know, I don't think of it as, like in the state monad, where you really have a state which is a refined data that you pass around. You don't have that here. S doesn't exist. S is just a phantom type. It's a type level of tag. Whoop. We're done. Yeah. Would you connect, do you want to try this? Try this in the Haskell, like, you know, in GHCI? It's time to digest what was just said. Okay. Thanks. Yeah. Yes. The slide on the interleave. SD, yes, right at the end. Yeah, the most annoying part of the... What's this slide about? You're saying that there's something interesting here. Yes. So interleave SD is the thing that duplicates the state. So the S goes in and the S also goes out. So it duplicates the state, which is basically, unlike everything else that we've done before, everything else, like the state goes, one state goes in, one state goes out.  It threads it through. Whereas interleave SD is, hey, what happens if we duplicate the state?  And what that does is that allows you to write, like this function, for example, this is a lazy, this is a lazy read file. And it works as long as, yeah. What does read CTS mean? Read contents. So it's a recursive definition. So if you read the contents of the file descriptor. So what this says is, basically, hey, I'm going to read the character, and I'm going to read the, sorry, I'm going to read the rest of the file at the same time. Okay. Yeah, essentially. Yeah, essentially. Yeah. How does it interleave as it is reading character sequential, no? I mean, it is, it is, it is sequential, but only because we won't demand the contents of the thing out of order. So what happens in this example, right, is that this gives you a string, which as you force it, as you force the first character, then it will read the first character. As you force the second character, then the second character will be read. So it immediately returns with a string, but the string is suspended. So in read file, right, like suppose you had some other code there, so you read contents of F, and then you do something else. That something else would run immediately. It wouldn't wait for the whole file to be read. It would only read the file as you force it, right? Which would mean it holds the file descriptor. So it's like lazy art. Yeah, yeah, exactly, exactly. So if you're like working on something that assumes the file descriptor is closed, or I think you're like... Yeah, that's where you go. That's exactly where, you know... Well, that's the thing. It has to use them in a strict, like in a strict or statefully threaded way, or it has to, I think... We didn't do this, right? So this seemed like a good idea 20 years ago. It seemed like a good idea 15 years, five years ago. But it's increasingly obvious. We have learned that it's not... So there's approaches that kind of use, I think there's continuation, like a continuation based approach. I think you probably know more than this. Yeah, like pipes. Yeah, pipes and conduit, yeah. So basically the way of saying that, hey, we will control the resource, but you can give us a function that will tell us what you want to do with the contents of the resource. So then you run the function, but it itself keeps control of the file handle or the resource. So this is super relevant. This approach is really nice, right? In a small program. You just read the file, really, because you only read it as needed. Because it works out and everything can be fewer. And it's not that elegant. I mean, it's not that simple if you use the proper approaches. You have to be a bit more explicit, but it's worth it because the operational benefit, exactly in resource management and exception handling, et cetera, is worth it compared to this approach. So does it mean right now, like I said, in Haskell, when you read a file, it actually meets the whole... It reads lazily. This is essentially the way Haskell works right now. Yeah, in the standard library. Yeah. Yeah, they have the libraries which... Well, they have other libraries that go ahead. This was a bad idea. Let's do it the other way. Also, there's also the strict form of... Yeah, you can choose. I mean, you could write this in the strict form, right? Because you could have... If you just leave the inventory listed up, this is the strict... Oh, I see. Okay. Yeah, this might have made more sense with another box thing, but I was tired of turning those into Ascii, so I chose not to. Cool. Other questions? Yeah, but speaking of parallel, how does this gel with things like concurrent Haskell, where you could really have parallel... Would you have multiple states? Again, there's only one state. If the state token is this... So the way that it works is that you have... The state token itself is what determines the data dependency, right? Yeah. So you won't have the same state token across two different... Oh, no, no, sorry. So, yeah, RunST is not... Sorry. RunST is not meant to be used concurrently. Like, if you use it concurrently, bad things will happen. They have other ways of doing it. Yeah, yeah. Yeah, it's not. So they have other types of variables. They have, like... That's software transactional memory. I think that's another bunch of papers that would be fun to read and understand. But, yeah. Yeah, software transactional memory. They also have, like, I guess, mutex-based variables. They have a whole bunch of concurrent and parallel abstractions. But RunST is not one of them. Okay. In fact, yeah. I don't think IO is one of them because IO is based on ST. Like, this is the way things actually do work in Haskell. So... Does that mean, before this paper, there was no IO? Oh, yeah. How did the IO ask you? No, they had a different way of doing IO. They had, I think, based on, like, uniqueness types. So they basically had a really hacky solution. Like, this is one of the reasons that they decided to try this in the first place. So the uniqueness thing... No, that's a clean... Oh, okay. That's a clean thing. So what did they have instead? So the old ancient Haskell is doing IOs basically only using laziness. So you would have, like, a program that does IO would seem to be a program which, given a list of reads, produces a list of writes. And both are lazy, which is what allows, you know, the second read to depend on the first write. If you think about, like, a simplest program that does IO, which is, like, a text... interactive text program, right? Yes.  But maybe what you write out determines what you will read next. Because maybe, you know, people have a human, right? They read the first line and they decide what to type in the second line. But you can model it... You can model it as just two lists of, you know, an input list and an output list and a function which, given an input, gives you the output. And it just has to be careful that it only forces enough of its input to determine enough of its output. So it's part of the runtime? Is it part of the, like, the runtime? Yeah, and then, like, the runtime, which is, you know, on top of you, basically does the opposite of this. It feeds you enough of the input and it forces enough of the output that it can actually, you know, communicate with the outside world. Yeah, but I mean, it wasn't principled and it wasn't elegant. Yeah. Yeah, so they were like... It's easy to get loops and... Yeah. They're like, hey, can we do better? And, like, it has tons of the answers, yes. So... So is there anything else, like, on the horizon for Haskell? This is pretty much... Oh, there's a ton on horizon. This is, like, this is 23 years old. But it works really well for... It works relatively well for IO. It works relatively well for, like, mutable variables. You can write really fast code in Haskell that does stuff using this machinery. But, like you mentioned, hey, what about conco... You know, what about machines that have more than one core? Like, unthinkable in 94, right? Like, personal computers with more than one core. Yeah, for that you have other... You have other concurrency abstractions and other, like, variables. Yes. It's actually one of the most important open pastures of functional programming theory that there's a conjecture that... Okay, so there's a theorem which says that any imperative algorithm can be turned into a purely functional one with logarithmic slowdown. But it's a... It's not known whether it is true that you always potentially have this logarithmic slowdown. Like, it's an open question whether there's a way to turn any imperative program, a program which uses mutable references, et cetera, into a pure program which doesn't have logarithmic slowdown. And that, you know, that's the ultimate question behind this whole area, right? Because the reason you need ST is because you want to avoid the slowdown you get from your mutable data structures. But maybe you don't need to. Maybe you can avoid it, you know. Yeah, and so, again, the way that they... And I guess an interesting thing about this functionality is that this is, in a sense, a very limited form of linear typing. I think in linear types, essentially you have to use the argument only once. But you have to, yeah, once and only once. And this is a very limited form of it. And again, it's useful, you know, it's useful. This is the way Haskell works. They're trying to bring more of that into Haskell. So there's currently work going on trying to incorporate linear types into Haskell proper. And that's interesting as well. I guess it's something worth mentioning. And I guess the other thing worth mentioning is like monads in general. So this syntax, the do notation itself, came into Haskell through hugs, which was a different alternative Haskell implementation. And before that, they had the concept of monads. And predecessor to this paper they added bracket syntax that is similar to do notation but not the same. So for me, this paper is about two things. It's about the rank-to-polymorphism. It's about the monadic interface. And I think, again, you know, especially in hindsight, you can see that the fact that you have monads gives you a very general API for working with things, just things. Like this sequence underscore is useful in general. It's not useful just for I.O. This double arrow thing is useful in general. It's not just useful for I.O. And even their names are very suggestive. Like then, there's the idea of the monad as a programmable semicolon, which is like, come on, what does that even mean? But this kind of gets at what it means. It's like the then statement. What does then mean? It's a way of kind of sequencing your things. So in place of your, you know, yeah. And the fact that you have do notation and the fact that you have, you can define what happens between each line essentially means that that's, it's a really useful interface. It's really cool. So monads rank to polymorphism, linear typing, kind of laziness, strictness, C-interfacing, imperative functional. It's just, this paper has a lot of cool stuff. And it's relatively well presented. It's like, this is really short. There's a follow up called state in Haskell, which goes into a greater detail. It's about how to generate an infinite supply of variable names, like an infinite supply of identifiers, which is an interesting problem. And there's like more cool stuff in that paper. And there's a predecessor that talks about do notation, before do notation. So this is an interesting bunch of papers to have a look at. But especially this one, I think, because it's accessible. It's interesting, but there's not too much to take in. Cool. Think. That's it.