I got that section loosened. Now I need to attach two pipes in here. It looks like it fit pretty good, but I'm starting to have a thought. I know it happens once in a while. So this is gonna have a tube that goes up inside. There's gonna be a motor at the top and a bearing, and down at this end I need some kind of bearing too. And, alright. The way I think would be the best way to make the bearing is have the tube actually come through the hole and stick out. Partway, anyway. Then I can make a plastic bearing in there, and since the tube will stick out past, I can have some inlet holes for water that will run through the plastic bearing so it won't overheat, so it'll have water going through it. That's gonna be harder to do if I have the tube just up inside. So I might just make this half of the the hole just as just like normal. Then drill the holes, put the pipes in, and then I'm gonna have to fiberglass them in after the fact, which will be significantly harder, but it solves the bearing issue at the bottom. Alright, so that means this is nothing. I'll do something with it. I'm not sure if it works super well as a hat. I think I might have to keep looking for things I can do with this. Alright, there. Got the rest of this pontoon finished. I think this is one of those cases where, you know, I kind of saw a problem and then I was like, well let me fix that, but it created more problems that were bigger. So a lot of times just the most obvious thing is totally the thing to do. It rained all day yesterday and this thing looks like it holds water, so that's a good sign. The thing I'm concerned most about here is just where the two halves connect. Like I want this to be flush. So as the water comes by it just runs right past and it looks like I nailed it. Yeah, there's a little bit of a bump here where the seam is, but I'll sand that out overall. Yeah, lined up really well. This back part came out really good too. Let's probably get it cut off somewhere around here. The water line will be down here somewhere. And it just gives a nice vertical surface where I'll be able to make some kind of hingey thing and have a rudder come off here. Hopefully I can come up with an idea that makes it so the rudder kind of lines up with this edge so it can stay really streamlined. Shouldn't be that hard to figure out, right? I guess next operation is trim this top edge. My workshop is so packed right now. Somewhere back here I've got some things. I'll wreck my good ones. That's the ones. These are my oldest ones and they're in rough shape. They work on the fiberglass. I do really like the looks of this. I think in reality this curves a little bit more than in the picture. Let me see what happens if I just hold a ruler at the top edge and see what it looks. Yeah, I need a wide angle lens to do this. Alright, so I cut that right like that. That's actually really good. Yeah, that totally leaves enough on the front and the back. And at the front I probably still want to keep it down a little bit. At the back too. Yeah, I really see on the camera screen but I think the line's showing up. Right about there. I think that looks good. It comes down low enough in the front here. I probably won't angle it. I'll just leave it straight like that. Yeah, I like it. And then at the back this is supposed to come up to where the chair is. Like the backrest and the motor will kind of be up there somewhere. So I shouldn't cut all that off yet. I need to make a new line coming up. This is about where my butt will go. And that pipe is the width of the pedal boat butt area which is about as skinny as I'd want it to be. I have to press this out a little bit but I think it's, I think it's alright. Ooh, it looks so fast. This isn't really there. That's just propped up there. This is gonna have a piece that comes up and then goes down to where the chair is right about there. I checked. My butt fits in here. I guess I shouldn't do this part up here until I get the pipes in. Alright, I did some measurements on my pedal boat to figure out good spacing between the pedals which go right there. There's a little circle. I don't know if you can see it. And then the chair which is right here. So I'll fit in there good. There's still space in the front for a couple people to sit and then you know a cargo zone in the front. And then back here there's the line. Hopefully the camera can see the line there and the one here for where I want to put the pipes. The pedal pipe I'm gonna make thinner than the motor pipe because the pedal one's not gonna have as much power as the motor one. The motor one is gonna be a hollow one inch diameter tube and the pedal one I think I'll do a half inch. So I can use a smaller tube here and a bigger tube here. Alright, this is not gonna be the easiest cut. I think I've got that lined up right where it needs to go. Now I need to get a piece of fiberglass on there before anything moves. Okay, I think I got that slopped in there pretty good. The hardest part by far was under here and I'm not sure if I got the fiber glass you know total coverage under there because it's such a deep like little cavern. So I just took a chunk of this and blobbed it up and put a bunch of resin in it and like stuffed it in there like a plug and then put a piece of paper that piece of paper right there and just stuffed it in to make sure it's all sealed. So that should be good. And when that's hardened I'll wrap this with fiberglass all the way up to you know wherever it needs to go. I guess I'll need to need to support it at this end at some point. I'll worry about that later. And now I have to do the other pipe which is back there, a fatter pipe. But basically the same process. It looks like a whale. It's too bad this isn't gonna stay there or I could put an eyeball up here and just make it a whale. Anyway. Alright, got both tubes in. That is great because that's the technically hardest fiberglassing part of the whole boat. Ah, nice work. Looks like they pretty much line up with my lines there that I drew. You can't tell because I'm not right beside it but yeah when you look straight from the side that lines up right with my lines. The same with that one up there. Excellent. Alright, totally solid. Both pipes get cut off just a little bit down from the level of the top there. So to get leaks through these pipes the water level will have to come all the way up to here. But at that point I'm probably sinking the boat anyway so I should be fine. The water level will always be down here somewhere. Man, I'm really happy with that. That came out so good.


The next item of business is a member's debate on motion 2197, in the name of Colin Smith, on Marie Curie's report on challenging inequities and palliative care. The debate will be concluded without any questions being put. May I ask those members who wish to speak in the debate to press their request-to-speak buttons? I call on Colin Smith to open the debate around seven minutes, please, Mr Smith. Thank you, Presiding Officer. Can I refer members to my register of interest where it states that I was employed by Parkinson's UK when I was elected to Parliament, but that employment has ceased. I want to begin by thanking members from across Parliament for supporting my motion, allowing what is a timely debate on palliative care to take place today. It's just over a year since the Health and Sport Committee published its third and far-reaching report, We Need to Talk About palliative care. That was followed by the publication of the Scottish Government's strategic framework on palliative care and end-of-life care, a framework with a vision that everyone in Scotland who needs care has access to it by 2021, a vision that I know all members share and support. It's an opportune time to take stock to reflect on what progress has been made in achieving this vision and what more needs to be done over the next five years to ensure that it becomes a reality. Marie Curie's excellent report on enough for everyone challenging inequities and palliative care is an important contribution to that debate. It brings together the key findings from discussions from a seminar held on 15 September 2016 by Marie Curie, where more than 70 experts from across the country came together to talk about the challenges of inequities in palliative care and to seek solutions. The report highlights the research that was commissioned by Marie Curie and published by the London School of Economics in 2015 that showed that it is estimated that one in four people in Scotland who die miss out on vital palliative care. That's an estimated 11,000 people in Scotland who need palliative care each year but don't receive it. It's also important to recognise the benefits of specialist palliative care for people with long-term conditions such as Parkinson's and other progressive neurological conditions from the point of diagnosis and not just for those requiring end-of-life care. It's clear that over the next five years over 55,000 people in Scotland may not receive the palliative care that they need if we do not ensure that the vision of care for everyone who needs it is delivered. By delving below those figures and highlighting the barriers those who receive less care than others with comparable needs, the work by Marie Curie makes a significant contribution to the debate on how we can deliver that vision. Although it's not an exhaustive list, the report shows specific groups of people less likely to receive palliative care, including those over 85, those from Black, Asian and minority ethnic communities, those who live alone and those who live in areas of deprivation. If we look at each of those groups in turn, we can see some of the reasons for those inequities. In Scotland, nearly 82 per cent of deaths occur in people over 65, yet older people are much less likely to receive the palliative care that they need at the end of life when compared to younger age groups. Marie Curie highlighted a number of reasons for that, including the fact that all too often older people may think that their illness is just them getting old. There are also factors around the underreporting of serious illnesses and the under-identification of older people for palliative care. That becomes more complex around the issue of frailty with frail older people often dying without a defined single terminal illness and without receiving the benefits of palliative care. A number of recommendations are made in the Marie Curie report to help tackle that. For example, providing clearer information for older people as to what services are available to them and how to access them. More effort is needed to identify triggers for palliative care in older people, particularly those with frailty. Practitioners need the right training and support to ensure that those who require palliative care are identified from the point of need. The challenges of inadequate training and support has also been identified by Marie Curie as creating a barrier to palliative care for those from Black, Asian, minority and ethnic backgrounds. There are now more than 200,000 people living in Scotland from a BAME background, double the level of 2001. However, many do not access the palliative care when they need it. The Marie Curie report highlights the fact that, when people do receive care, it is not always sensitive to the different cultural and religious needs of BAME groups. There is also fear of discrimination, a lack of translation services and a shortage of female doctors for Muslim women. As well as more training and support for those providing palliative care, Marie Curie highlights a need for more research at ground level in the field of care to ensure that the needs of those living in BAME communities are being identified and evidence-based solutions are found to meet those needs. Research that is funded by Marie Curie into access to palliative care for lesbian, gay, bisexual and transgender people also found that discrimination and a fear of stigma was a factor when it came to accessing palliative care for LGBT people. There is also a clear disparity in the access of health and social care services between those living in the most and least deprived communities throughout the country. For example, the report highlights that those living in the most deprived communities are 33 per cent less likely to die at home compared to those living in the least deprived communities. Again, a number of reasons are given as to why people from deprived communities may not be accessing palliative care in the Marie Curie report. The need for far more public health and social care support in deprived areas is recommended as one way to help to break down those barriers. It is clear from the report that there are significant inequities when it comes to the provision of palliative care across Scotland. If we are to meet the 2021 vision, we need to break down those barriers. The Marie Curie report highlights a number of recommendations and common themes that can help us to do that. One such theme is about research and data. Professor David Clarke, who members will know, leads the University of Glasgow's end-of-life studies group based in Dumfries, stated in the report for the Health and Sport Committee in 2015 that a serious information deficit needs to be filled on data relating to the provision of palliative care in Scotland. There is clearly a distinct lack of research and palliative care compared with other health issues. I am pleased that the Government acknowledges that in the strategic framework, so I hope that when the minister is responding to the debate today, she can outline how the Scottish Government plans to support the development of an evidence base to show progress towards its 2021 vision. The forthcoming national review of health and social care targets also provides an opportunity to reconsider the current indicators that are used by health and social care partnerships when measuring palliative care to ensure that better data can be collected to fully measure the inequities that exist. For example, measuring access by clinical condition and social economic group. Breaking down the barriers that are highlighted by Mary Curie means providing personalised, effective palliative care in a setting that suits the individual. It was encouraging to read in the Government's health and social care delivery plan that was published last month that the availability of care options will be improved by doubling the palliative and end-of-life provision in the community. I hope that the minister will outline how exactly that can be achieved, while it, for example, means additional resources for integrated joint boards to scale up their palliative care provision in the community. The final theme that I want to touch on that comes from the report is once again the fact that talking about palliative care and dying does not come naturally to many including myself, even though death is the most unavoidable event in our lives. Of all the areas in the Government's framework, I think that this area is the one that least progress has been made. The Health and Sport Committee wrote to the cabinet secretary on 16 November about progress in the implementation of the framework, and in the reply, the cabinet secretary said that the Government did not plan to run a national campaign in relation to death and dying. I therefore would be keen to know from the minister how the Government intends to deliver the equipment to support greater public discussion on death and dying care at the end of life. I am very conscious of time, although I have only been able to touch on a fraction of the issues in the report, and no other members will more than adequately fill the gaps that I have left. I look forward to listening to those contributions and also to listening to the minister on the points that I have raised. In conclusion, I want to place on record my thanks to Marie Curie not only for her work on the report that we are debating today, but for the outstanding care and support that she provides for over 8,000 people and their families across Scotland.  The focus on my contribution has been on tackling the inequities in the provision of palliative care, but I know that tens of thousands of families benefit from the outstanding palliative care being delivered across Scotland every year. However, we are ambitious, and that is why we are all determined to see the Government ensure that care is there for everyone who needs it, wherever they live and whatever their background. I would move to the open speeches of around four minutes, please. Can I have Bob Doris, followed by Donald Cameron? Thanks, Presiding Officer, and I start by thanking Colin Smyth for bringing this matter to Parliament today, and also to Marie Curie for the excellent report on challenging inequalities in palliative care. I was the deputy chair of the Health Committee when that report was drafted. I am currently, along with Colin Smyth, on the cross-party group of palliative care, but I want to speak today from a more personal point of view. In December 2015, my mum passed away, frail, elderly and admitted to a care home a year earlier. The underlying reason for passing away was vascular dementia, mum passed away and a hospital. In May 2016, my dad passed away as a Margaret's Hospice in Clydebank. He had been diagnosed with lung cancer a few months earlier. I mentioned them for two reasons. First, I like talking about them. I think that it's important that we continue to talk about people who have lost that part of dealing with grief, but also because they are two very different end-of-life pathways if you like in relation to palliative care. The motion before us and Marie Curie's report believes that more needs to be done to identify the triggers for when palliative care should kick in. I would contend that, quite often, it kicks in, but we don't call it palliative care. Indeed, there is no agreed definition of what palliative care actually is, and that's a bit of a stumbling block as well. In my dad's case, it seemed fairly clear that it was cancer and that it was terminal. Can you stay at home? That's just not a starter when you deteriorate. Let's look to see if a hospice place is available or be forever grateful for the support that St Margaret's and Clydebank gave to my father. However, we have to go beyond the traditional routes to palliative care for certain types of terminal illnesses and cancers, obviously, one where there is a clear pathway and others not so much. I should put on record that Marie Curie's hospice is indeed in my constituency of Mary Helen Springburn, and they do an excellent job. In the past year, they have had 486 admissions, 30 beds, and they do a wonderful job not just in the hospice but across the wider community, with a lot of nurse specialists and a variety of support that they give my constituents, not just Mary Helen Springburn but others elsewhere. However, if we are to look at my mother's situation, staying at home didn't become an option for her. She had to go into residential care. We didn't think at the time that it was because of the vascular dementia. We just saw a frail elderly lady, but vascular dementia is terminal. I have no idea if my mother counted as receiving palliative care or not. There was a well-intentioned muckiness around it, because care home staff don't like to talk about your loved one will eventually pass away. What happens if her heart gives way? That's not what happened incidentally, but what happens if her heart gives way? Do you want her to be resuscitated? Those are really challenging conversations that are not just clinically-led conversations, but often relatively low-paid care staff. Care homes have chats with families about what they would like to see with loved ones. The more general point that I want to make is that I think that every day of the week there are amazing contributions to palliative care happening at home with care at home staff, care home staff and hospice staff and beyond. I don't think that we count it. I don't think that we define it. I don't think that we always appreciate it and a lot more has to be done. It's also worth saying that I think that Professor David Clark was quite right in his powerful report that he did for the Health and Sport Committee, but he also said that we should remember that palliative care in Scotland is probably still, and this is not a boast, I have to say, probably about the best in the world. Everyone's playing catch-up, but there's so much more we have to do. We haven't even began scratching beneath the surface. I will give one final comment. Not everyone is going to get the specialist palliative care. It doesn't mean that you go to a hospice, but hospices have a huge contribution to making to the wider community, whether they become hubs of the wider community and have strong networks with local care homes and local care home providers and care staff that support those frail elderly at home. We should draw on their excellence and expertise, but we should expand what we do in the community. However, the biggest thing that we have to do in the community is to talk about death and dying and appreciate the fantastic work that already goes on out there. I thank Colin again for bringing this debate to the Parliament. I look forward to working collegiately across all parties and with the Government to improve the situation in palliative care. I call Donald Cameron to be followed by Elaine Smith. Thank you, Deputy Presiding Officer. I begin by thanking Colin Smith for bringing this issue forward for debate. It is especially relevant, given the shifting changes that we are witnessing to the way that health and social care are delivered, and also in the spirit of the on-going debate as to how we deliver healthcare as a whole. I also commend Bob Doris for his eloquent description of his parents' deaths. That frank recounting of his own personal experience says far more than any dry statistic that I or others might recite. I would also like to thank Mary Curie for providing extensive evidence in advance of this debate, including some in-depth analysis that was already referred to into a variety of minority groups who faced particular challenges. I look forward to hearing the contributions of others in relation to this issue. However, I begin by talking about the way that palliative care is delivered in my own region, the Highlands and Islands, and I concentrate on the role of hospices in Scotland in particular. Despite the obvious challenges that my region faces on a daily basis, given its rurality and relative remoteness—whether that is about infrastructure or lack of clinical services or the struggle to attract professionals to take up jobs—we are lucky that we have incredible and dedicated staff in the public and charitable sectors who provide that quality and dignified end-of-life care to thousands of people each year. In the Highlands and Islands, charities such as Mary Curie work in close partnership with our NHS and provide support to two hospices in my region, the Highland Hospice in Inverness and the Bethesda Hospice in Stornoway. Across Scotland, as a whole, Mary Curie has four volunteer helper groups and a vital befriending service that pairs some of the near 2,000 volunteers with those who require care and additional support. Such support is vital and we must continue to improve what we offer to patients who require end-of-life care and also to their families. I have also been privileged to visit the Cowell Hospice Trust in Denun, which is located within the community hospital there. I have been there twice since the election and had the pleasure of meeting staff and seeing the facilities on offer. It is a small hospice, but it provides incredible palliative care to local people, meaning that residents do not have to travel long distances to receive end-of-life care and can remain close to family and friends. It is also a hospice with strong community backing and with premises and equipment largely funded through local fundraising efforts. However, the reality is that that is rather unique not only to my region but to Scotland as a whole. As hospice UK note in their briefing, access to hospice and palliative care in Scotland is not equitable with thousands missing out on the care that they need each year, and as the motion notes, that is about 11,000 approximately each year. In many instances, those who require specialist palliative care in rural and remote areas either have to travel, which can entail a variety of additional problems or need to rely on such care being provided at a primary care level by a local GP or a nurse. When I delivered my maiden speech to Parliament, I spoke about the need for a greater focus on delivering vital services to people, especially those who live on the periphery of Scotland. That is the challenge when we must face it head on. One example of how we could improve the accessibility to palliative care is by piloting the partnership for excellence in palliative support, the PEPS scheme, which has been trialled by Sue Ryder in NHS Bedfordshire in England and was supported in my party's manifesto at the recent elections. PEPS involves the creation of a 24-hour phone line for access to all palliative care services, and it brings together 15 organisations in a hub and spoke model. It is just one example of integrating existing services better and massively improving access to vital specialist information. I look forward to hearing other contributions today on how we develop palliative care in Scotland and to ensure that the issues raised in Mary Curie's report are not only given proper attention but that we move forward to finally resolving many of the issues that remain outstanding. Thank you very much, Presiding Officer. Scotland has many organisations and charities that focus on those, either in need of palliative care or coming to the end of their lives. That is a good opportunity to commend and thank them all for the work that they do, as Donald Cameron has done. Today, thanks to Colin Smith, we are looking specifically at Mary Curie's report enough for everyone, which has raised awareness of the inequities in access to palliative care. Mary Curie nurses offer much-needed care and support to people living with terminal illness in the comfort of their own homes. I am sure that we have all encountered the excellent work, whether as politicians or personally. It is also important that we recognise the great work that is done in hospices around Scotland. An excellent example of what we are reaching is St Andrew's hospice in Airdrie. The hospice provides care to people living with life-limiting illness and is free to all, regardless of age, gender or creed, and it supports families. It is a real example of the kind of care that the report would like to see across Scotland. Like myself and my husband, the hospice has just celebrated its peril anniversary. For the past 30 years, many families in the Lanarkshire area, including my own, have had experience of the exemplary care that they provide. I am also proud to be an ambassador for the hospital's capital appeal, which needs to raise £9 million to refurbish the inpatient unit. That is quite a task, because it is in addition to the £4.6 million that is needed every single year to continue what they do, supporting and caring for patients, their families and loved ones. They have produced a little book called Perils of Wisdom, which contains inspirational and thought-provoking contributions to help to raise funds. One of the quotes in the book is from Cecily Saunders, the founder of the modern hospice movement, if I could just share it with you, which says that it matters because you are you, and it matters until the end of your life. A much under-reported issue that I would like to touch on now is access to palliative care for babies, children and young people. That is identified by the children in Scotland-requiring palliative care study. It found that over 15,000 babies, children and young people aged 0 to 25 years live with life-shortening diagnosis, and that two thirds of them who die each year in Scotland do so without access to specialist palliative care and support. That is a very difficult issue to talk about. Colin Smyth referred to such difficulties earlier, but it is one that needs addressed. Overall, we must find ways to encourage people to access the palliative care that they need. The Marie Curie report tells us that people living in more socially deprived areas are much less likely to access health and social care services, and that includes children and young people. I am sure that most people in the chamber, most members, in fact all of us, would agree that it is unacceptable that people are dying in hospital waiting in social care packages, so it is imperative that people are properly supported to live and die at home as they wish to. Everyone who is affected by terminal illness should have access to all of the care and support that they need, regardless of their personal circumstances, and that includes palliative care. I am going to finish by picking another pearl of wisdom from the book to share with the chamber. Sometimes what a person needs is not a brilliant mind that speaks but a patient heart that listens. I thank all the kind and patient-hearted staff and volunteers who provide palliative and end-of-life care. I urge the Government to quickly make their vision a reality so that everyone who needs palliative care has access to palliative care in an equal way. I thank Colin Smyth again for raising this vital and important issue in the chamber. I also thank colleagues for their moving and well-informed contributions. I am very pleased to contribute to today's debate. I especially thank Mary Curie, Sue Ryder, the Royal College of Nurses and Hospice UK for their excellent briefings on the important issue. Mary Curie's report into the inequalities in accessing palliative care is timely and it highlights where our focus needs to be to ensure that our health service not only strives to allow everyone to live well but to die well. Around 54,000 people in Scotland die each year. With an increasingly ageing population, the figure is set to rise with the Government anticipating a 12 per cent increase by 2037. The demands for end-of-life care will surely grow in response to that, as will the needs of those seeking palliative care. From palliative care's roots in the 1960s, providing meaningful pain management, care and emotional support to those with terminal cancer, today's palliative care must meet the challenges of a wide range of conditions. Mary Curie's report outlines how health and social care providers need to recognise the needs not only of those with terminal illnesses, but of those living with increasing frailty in their later years. Today's care must also respect and respond, and Colin Smyth spoke to this very well, to the cultural needs of different groups in our society, for example those of minority ethnic backgrounds and those identifying as LGBTQI. The report also notes that the challenges to accessing healthcare services faced by those living in areas of social deprivation extends into palliative and end-of-life care. The Government's strategic framework for action sets out the steps that we need to take to begin to set and measure indicators of palliative care provision across the country to ensure that everyone has access to the support that they need by 2021. It is that challenge of providing meaningful care to which I would now like to turn. Preparing for this debate, a common theme that has been raised across the third sector, across the NHS and Government, indeed in our neighbourhoods and communities, is the need for a more open culture around death and dying. Our healthcare workers will struggle to provide meaningful care if we are not ready to have frank and honest conversations about what a good death means to us as individuals, as families and communities. The Grasping the Nettle report from the Scottish Network for Palliative Care highlights that a cultural shift is needed for us to be willing to discuss these matters and that everyone has a part to play in bringing this about, not just care providers. The report says that too often our culture sees death as a medical failure. Blocking discussions about what it means to die well and how our services can fulfil that need. While the current policy focus on increasing independence in old age is essential for our aging society, I believe that that must also be balanced with policies and actions that recognise that sometimes ill health and death is inevitable. I know that the Minister for Public Health attended the realistic medicine event that probably several of us were at last night. I think that that shared decision making around some of those big issues and the opportunity to have a positive discussion about quality of life and what it means is truly welcome. Presiding Officer, we need to ensure that primary health workers have all the training and support that is required to open those compassionate discussions about what treatment and emotional support a person may want at the end of their life. Everyone should have the opportunity to plan ahead to tell their carers what matters to them personally. Grasping the nettle report and Sue Rider recommend a 24-7 helpline to palliative care professionals for patients to ensure that people feel that they have a sense of autonomy and control in making important decisions about the end of their lives and the care that they would like. In closing, I too would like to thank those who work tirelessly in providing end-of-life care, whether they are in the centre for integrative care. Hospice staff, such as Bob Doris, who have visited the excellent Marie Curie hospice in my region here in Edinburgh, are NHS professionals. All those who work in care, Scotland's many paid and unpaid carers. I look forward to the minister's comments on how we can progress those issues. Just before I call Richard Lyle, in view of the number of members wishing to speak in today's debate, I would be minded to accept a motion under rule 8.14.3 to extend the debate by up to 30 minutes. Can I ask Colin Smyth to move such a motion? Members in agreement. No one having disagreed, I extend the debate understanding order rule 8.14.3. Richard Lyle, to be followed by Dean Lockhart. Thank you, Presiding Officer. I begin my remarks this afternoon by welcoming this debate on the Marie Curie report and, of course, congratulating Colin Smyth on bringing this important topic to the chamber. I also wish to thank the Royal College of Nursing, Sue Ryder, Alzheimer's Scotland and Marie Curie for their briefings. I pay particular tribute to the service in Lanarkshire, which Marie Curie provides 448 patients seen in 4,164 visits, 24 seven-plan nursing service, 61 nurses in Lanarkshire, 93 per cent of patients supported by Marie Curie dying in the place of choice. Other agencies provide care in my area, but I know that Marie Curie supports the people of Lanarkshire well. Marie Curie lives up to what I would suggest is its mission statement. Marie Curie is here for people living with any terminal illness and their families. Part of care is wide-ranging. I want to focus on an area in relation to the topic that is of a particular interest to me and that is dementia. Bob Doris spoke very well in his speech regarding his mum's dementia. Indeed, it must be noted that, as life expectancy of people in Scotland increases, it is likely to mean that more people will experience dementia and the proportion of people dying with dementia will also grow. With that in mind, in November 2015, Alzheimer's Scotland published its advanced dementia practice model, which sets out a model for providing integrated personal centre care for people with advanced dementia and, at the end of life, which responds to the complexity and the intensitivity of advanced illness and dementia. That model is due to be tested as part of the implementation of the Scottish Government's strategic framework for action on palliative and end-of-life care, a framework that I not only welcome but commend the Scottish Government on implementing to ensure that we are dealing with this sensitive issue in the way in which the Scottish people would expect. It is also important that we in this chamber recognise that many people dying with dementia will also have other conditions requiring a care response. Whether dementia is not only their primary concern, it will have an impact on their experience or other conditions in any treatment that they receive and we must be prepared to deal with those situations. In the remainder of the time that I have in this debate, I wish to reflect on the Scottish Government's work and recognise the development nature of addressing dementia as it formulates health policy here in Scotland. The SNP Scottish Government published in March 2016 the proposal for Scotland's national dementia strategy, which was framed through the stakeholder engagement to identify the key areas that the Government can deliver for those with dementia. The strategy identified through stakeholder discussion that a Government should continue to focus on our national and local human rights, based approach to improve dementia diagnosis rates and services and supports at all stages of this illness and in all care settings. That should continue to be underpinned by the right-based approach to developing and upskilling the dementia workforce through implementing promoting excellence and the standards of care for dementia in Scotland. That is an important issue, as framing our action on dementia within a rights-based approach is absolutely the way in which we must take these matters forward. That, I believe, gets to the heart of what Colin Smyth's debate today is about, inequalities. If we are to adopt a rights-based approach, then we must continue to address such inequalities. Therefore, we know the issue of dementia and palliative care are deeply underpinned by the need to enshrine human rights as a fundamental pillar to what is being done. That is why the integration of advanced dementia practice model by the Scottish Government into the Scottish Government's strategic framework is so important. It recognises that human rights are a fundamental aspect to understanding the citizenship and the rights of people. I want to conclude this afternoon by once again thanking Colin Smyth for bringing in the important issue to the chamber. He is allowing me to reflect on the work that the Scottish Government is doing in dementia care and how we can continue to work together to improve the approaches that are undertaken on the most important of issues. I would also like to thank Colin Smyth for leading this important debate on maricuri and the report on challenging inequities in palliative care. As Donald Cameron said, I would also like to thank and recognise Bob Doris for his personal and powerful contribution in this debate. This debate gives us the opportunity to acknowledge and appreciate the invaluable work performed by maricuri nurses, staff and volunteers on behalf of everyone who has received their assistance, including people living with terminal illness, their families and loved ones. Equally importantly, this debate gives us the chance to highlight some of the challenges that maricuri has to address going forward, in particular the various barriers certain groups and society face in accessing palliative care. Despite the widespread recognition and deep appreciation of the palliative care services that maricuri delivers, the fact remains that there are still some 11,000 people who need palliative care in Scotland each year but who do not benefit from it. In other words, as Colin Smyth highlighted, one in four people died in Scotland without end-of-life care that they need. To address the gap in palliative care, research commission by maricuri has highlighted the inequality of access to that care across certain groups in Scotland. The fact is that certain groups of people receive less palliative care than others with a comparable need. As others have mentioned in this debate, that includes older people, black Asian and minority ethnic groups, LGBT people and people living in deprived areas. Another group that does not receive the palliative care required are people who have mental health conditions. Vulnerability to mental health issues is significantly increased for people living with a terminal illness, and that can often go untreated and unsupported. People often develop mental health issues as a result of their terminal illness, and there are many people suffering in this area who are not getting the support that they need. That was highlighted to me as a major challenge when I spoke to Marie Curie earlier this week. It is therefore increasingly important that we ensure that there is a range of support available for those who need end-of-life support. That includes access to psychiatrists and counsellors, as well as suitable medication. It is also crucial that we see more support for families and carers of people with a terminal illness and the further integration of health and social care services. On the issue of integrated health and social care services, I am pleased to highlight the success of a Marie Curie hospice at home pilot that has recently been implemented in my own region of Fife. The pilot in Fife was introduced to complement existing Marie Curie services, and it has three key elements to it. First of all, a managed care service with nursing care for patients and carers, which is what most people associate with Marie Curie. Secondly, and this is where it is an innovative scheme, it also offers a fast-track discharge service, which includes emotional support and practice assistance following a patient's discharge from hospital. Thirdly, the Marie Curie helper service provides companionship, emotional support and practical information by trained volunteers. All of that together is a very powerful service. The hospice at home service in Fife provided over 4,000 visits per year and meant that many more patients were able to return home from hospital in their final days. I do not want to quote numbers here, but it is important to highlight that 74 per cent of patients were able to leave hospital under the pilot scheme compared to 30 per cent previously. Everyone will agree that that is a great improvement. The Fife hospice at home pilot is a great example of integrated health and social care, and I commend everyone at Marie Curie involved in the pilot scheme. I hope that that can be expanded to other areas in Scotland. It is a testament to the hard work and forward thinking of everyone at Marie Curie. I thank Colin Smyth for bringing this important debate to the chamber and, as other members have said, I extend my thanks and best wishes to everyone across Scotland in providing palliative care and their valuable and invaluable support in this area across Scotland. The last of the open debate speakers is Monica Lennon. I would also like to echo colleagues in welcoming the opportunity to have this debate today and pay tribute to my colleague Colin Smyth for raising the important issue. The Marie Curie report on challenging inequities in palliative care is a welcome and sobering recognition of the problems that many patients face when accessing palliative and end-of-life care. I feel like I've learned a lot already from colleagues' contributions today, particularly thanks to Bob Doris, but also from the briefings that we've had from Marie Curie, Royal College of Nurseries, Hospices UK and others. We know that deeply entrenched inequalities unfortunately exist in many areas of life right across Scotland, and deprivation is often the major precipitating factor that affects that. People from deprived areas already suffer from disproportionate health concerns and access to health and social care services. Sadly, this is no different when palliative care is considered. Despite the fact that people in Scotland's poorest communities are much more likely to have numerous hospital visits to require palliative care and dying hospital, areas with multiple deprivations have fewer referrals to palliative care service, even when similar diagnoses are made compared to less deprived areas. That is troubling, and I support the calls from Hospices UK and others for more support to be given to improving the data on the barriers to care that people experience. It's equally concerning that the report highlights the existing patterns of discrimination experienced by Black, Asian, minority ethnic people and LGBTI people, as Colin Smith and others have highlighted, which can contribute to the lower levels of palliative care that are received within those groups. More research needs to happen to allow us to better understand this problem and how it can indeed be solved. Elaine Smith made an important contribution highlighting the needs of babies, children and young people in particular. Dean Lockhart has just touched on it, but I think that it should also be reinforced that a significant issue in palliative care is the consideration of mental health. The report notes that at least 10 per cent of suicides are linked to terminal or chronic illness. In addition, those living with severe mental illness tend to die earlier than the average population, and existing mental health issues can be made worse by physical illness. Mental health can affect those living with terminal illness in a number of distinct ways. Mental health problems such as depression and anxiety can of course be triggered by the diagnosis of terminal illness and in turn make physical conditions worse. There is also a wider issue regarding the mental health of family and carers through the course of their loved ones condition and subsequent bereavement. Palliative care is a holistic treatment that is well placed to be in keeping with approaches that treat mental health and parity of esteem with physical health, but any approaches to improve the inequity of provision should be mindful of that going forward. I hope that the Scottish Government will be mindful of Mary Curie's calls for a fourth stage in the mental health strategy for dying well to ensure that patient carers' family and friends are given adequate support throughout the patient's condition and subsequent bereavement. Those who are dying with a mental health issue can often be overlooked as part of the conversation, and I hope that that will change with the forthcoming strategy. In order to make those changes, there are a number of steps that can and must be taken if we are to achieve the vision set out in the Scottish Government's framework for action on palliative and end-of-life care, that everyone who needs that type of care will receive it by 2021, and many of those have been outlined by hospices UK. I am mindful for a time when there was more that I wanted to say, but I appreciate the timespinning that is already today. Again, I would like to pay tribute to local hospices in my area, South Lancer Cobright Hospice, as is my nearest hospice Elaine Smith has mentioned, St Andrew's. I think that we all appreciate the fantastic work and the fundraising that goes on as well, but I will finish there, and again, thanks to colleagues for their contributions today. I now call Eileen Campbell to close the debate. Around seven minutes, please, minister. Thank you, Presiding Officer. Unlike others, I also welcome the enough for everyone report produced by Marie Curie, and I thank Colin Smyth for bringing forward that motion. The other members of the palliative and end-of-life care cross-party group and other members more generally for their contributions to the debate this afternoon. I think that the openness of this debate perhaps is in contrast to the fact that, as a nation, we are not often great at discussing death and dying. We are often reserved and private, which has not helped us to face the certainty of the death that all of us know and love with the clear sighted and practical compassion that it calls for. I would also like to particularly thank, as others have, Bob Doris for his contribution and the openness about the recent passing of both his parents. I would also like to thank as well Alison Johnson for her remarks, and I agree with her that this debate fits well in with the empowering discussions that our medical services need to be having with people as part of that realistic medicine approach. The findings of the Marie Curie report are important and will help us all to move forward on our shared vision of ensuring that everyone, including those who have not been accessing palliative and end-of-life care, do indeed get access to it. The demand for good person-centred care is growing. We have more people in Scotland living longer, and that is a good thing. As we grow older, more of us grow frail, with multiple long-term conditions involving specific palliative care needs—needs that the report shows are not always being met. We want a fairer Scotland, and that report reminds us of the challenges that we face and which we are taking concrete steps to address—that rights-based approach that Richard Lyle described. We are committed to understanding the needs of our different communities, and we want to eliminate discrimination, reduce inequality, protect human rights and build good relations by breaking down barriers that may hinder people and prevent them from accessing the care and the services and the supports that they need. Our strategic framework for action on palliative and end-of-life care was published in December 2015, and it set out our vision that by 2021, everyone in Scotland will have access to high-quality palliative and end-of-life care, which is tailored to their individual circumstances, support that meets the needs of their point of needs. Wherever that personal situation or individual characteristics may be, it is what each of us would want for ourselves or those we care about. A tailored approach is absolutely critical if people are to have the benefit of high-quality palliative and end-of-life care, regardless of their age, their mental health points that were made by Dean Lockhart and Monica Lennon, their wealth or poverty or where they live. Any response to the needs that we face will require meaningful engagement with local communities and with our Scottish society as a whole, building on the endowed assets and strengths that we have across all of our communities. It is therefore essential that we create the right conditions nationally to support the local communities in their planning and the delivery of palliative and end-of-life care services to help to ensure that the unique characteristics of each individual are met. That is reflected in our framework for action, which contains a series of commitments to help to improve palliative and end-of-life care in ways that are sustainable and work for both the Scottish population as a whole and for those groups that are identified in the report. We have already done much national work to facilitate and support the local planning of palliative and end-of-life care services through the integration of health and social care, one of the most significant reforms since the establishment of the NHS. Integrations authorities bring together NHS boards, local authorities and others to ensure the delivery of efficient and integrated services. Such services, including palliative and end-of-life care services, are commissioned in response to the needs and choices of people and communities based on real, local understanding and flexibility. Key to the success of the work is the ability of integration authorities' power to drive forward real change. They will manage more than £8 billion of resources that NHS boards and local authorities previously managed separately, representing more than 50 per cent of territorial health boards expenditure and more than 80 per cent of local authorities social care expenditure. With a greater emphasis on community-based and more joined-up care, integration aims to improve care and support for those who use health and social care services. That will help to better equip providers of local palliative and end-of-life care to meet the unique needs of each individual in their communities. That compassion that has been so evident in the services that Donald Cameron, Elaine Smith and many others described, and that innovation that was felt in the description of the fast-track service that Dean Lockhart spoke about in his remarks. I set out in our strategic framework for action that we have asked Healthcare Improvement Scotland to test and implement improvements in the delivery of palliative and end-of-life care. That work includes developing better ways to identify all those who might benefit from palliative and end-of-life care, especially the frail and the elderly. To date, five integration authorities, including Glasgow City, East Ayrshire and the Western Isles, are collaborating with Healthcare Improvement Scotland to live well in communities and to focus on dementia improvement teams to take that work forward. Of course, data is vital. Without it, we will not know whether people are indeed getting the palliative and end-of-life care that they need. That was a point that was made well by Bob Doris. Without it, local communities cannot commission services to meet their people's care needs and care plans remain hard to share. This data challenge is also recognised in our framework for action, which includes a commitment to support improvements in the collection, analysis, interpretation and dissemination of data and evidence relating to the needs, provision, activity, indicators and outcomes in respect of palliative and end-of-life care. Our working group is tasked with clarifying the data requirements to ensure that they are valuable for both individuals receiving care and to assist integration authorities in planning, commissioning and improving their local services. Working with NHS Information Services division, the data group is also investigating a number of areas in which data collection can be improved. That will include exploring avenues for improving the data available relating to specific groups of people, including those that were identified in Mary Curie's report. Ilein Smith, I thank the minister for taking the intervention. Is it difficult to discuss whether that will include a particular focus on children and young people from deprived areas who seem to be a particular group that does not access appropriate care? Ilein Campbell I will take on board the point that the member makes from a previous portfolio. I know that that will be work that might be of interest to Mark McDonald in the early years. Through that portfolio, there is an awful lot of support for cruise bereavement counselling and others, as well as recognising one of the things that struck me in that time and that post around the support that siblings require. If there is a death of a child, often times they are the ones that are overlooked in the support that is required. I think that there is a whole host of other areas that we probably need to have an attention and focus on, particularly around child bereavement and child death. It is difficult to talk about, but I do not think that that is any excuse to shy away from the realisation that we always need to do as much as we can. I think that the GERFEC approach is probably quite appropriate for that and the points that Ilein Smith raises as well. Finally, in the moments that I have left, I want to turn to the values and the skills that people need from our health and social care staff. I started at the start and, as others have said, how hard we find it as a nation to discuss death and dying, yet it is a skill at having these difficult conversations, which is absolutely critical for anticipatory care planning conversations. Having those conversations and sharing what matters to the person at the end of their life can make all the difference to how and where they die. The demanding and challenging staff development that is reflected in our framework contains a commitment to support the development of a new palliative and end-of-life care educational framework. NHS Education for Scotland's NES is working with the SSSE to develop a consistent approach to workforce learning and development and to sharing practice right across the country. Lastly, I want to say a bit about palliative and end-of-life care research. That was a big focus of Colin Smyth's remarks. As part of the framework that is set out in our framework, we have established a research forum that will complement the aims of the framework. We have provided funding to support the group to undertake a systematic review of more than 400 relevant research studies to help us to develop a clearer picture of research and data gaps and to support improvement. Uniquely among the devolved nations, the Scottish Government has also committed funding for a strategic collaboration with Mary Curie. That funding supports a call for research projects addressing priority areas addressed by the James Lind Alliance priority setting partnership and palliative end-of-life care. Two research projects to date have been successful in obtaining funding, and those will be announced shortly. All of those will be helpful in realising the vision for palliative care, adding to the existing evidence base around palliative and end-of-life care. In closing, I again welcome the opportunity to respond to this report from Mary Curie and, naturally, welcome Mary Curie's support for the Government's strategic framework. To close with the words read by Elaine Smyth that we all, I think, can unite behind, you matter until the end of your life. Our job now, though, is to make that a reality. This meeting is suspended until 2.30pm.


Hello friends. Let's solve the following question. It says integrate the following function The given function is root ax plus b. Let's now move on to the solution Let i be the integral root ax plus b dx now What t is equal to? to ax plus b. So dT by dx is equal to a and this implies dt is equal to adx and this again implies dx is equal to dt by a Now dx is dt by a and t is ax plus b. So substitute all these values. So i becomes integral root t dt by a and this is Again equal to 1 upon a integral of t to the power 1 by 2 dt Now this is equal to 1 upon a Integral of t to the power 1 by 2 is t to the power 1 by 2 plus 1 upon 1 by 2 plus 1 Plus c as the integral of x to the power n dx is x to the power n plus 1 upon n plus 1 Plus c. So here n is 1 by 2 So this is equal to 1 upon a Into t to the power 3 by 2 upon 3 by 2 plus c Which is again equal to 2 by 3 a into t to the power 3 by 2 plus c Let us now substitute the value of t here. So this becomes 2 by 3 a ax plus b To the power 3 by 2 plus c Hence the integral of the given function is 2 by 3 a ax plus b Whole to the power 3 by 2 plus c and this completes the question. Bye for now. Take care. Have a good day


So, hey everyone, good morning, welcome to this session. Okay, quick introduction, my name is Ankit. I'm one of the co-founders of ClearTax. For the longest time, I've been a big fan of functional programming. Over like 10 years of coding, I've been a huge fan of functional programming. But I never really had a chance to work with any functional language in production. So, in ClearTax, when we were actually launching a new product, that was a time when we got a chance to use F sharp. And I'm just going to talk about that story. But I would not call myself really a great functional programmer yet. I'm still learning. It's a very long journey. The talk will be structured in high level. I'll first talk about the product we were building. What was the use case? And why we ended up choosing F sharp? What was the reasons? Then like during the initial development period, what things we saw which were useful for us and what something talks or wrote box we had. And as time went ahead, what did we learn? And like, how did we improve the code base? And yeah, I'll summarize with some learnings as well. So the product I'm talking about is a site called clearTDS.com. This is a B2B application for filing TDS returns. So very short introduction to the product. Like anytime you get a salary, you have some tax deducted from it, right? So the company, the employer has to do a TDS return filing with the government. This is sort of a quarterly filing. And it is very critical in the sense that they have already deducted this money from your account. So if they don't report it to the government properly, basically it's a huge hassle for everyone involved. And not just from salary, but any sort of transactions. For example, even if you were, maybe if you are freelancing, can you get money on contract or something like that, you probably would have TDS deducted there as well. So this product is the first SAS base product for filing TDS returns in India. And we built it and launched it early 2014. This is before we got into YC. So back then the team was very small basically. It was just two, three of us. So we decided to build this because it was a huge market need that there were no good tools for this problem. But also like while building this clear tax as a product was also there. This was the second product we launched. So I was just wanted to talk about the requirements of this product. TDS return filing software cannot be wrong because if you make a mistake in a financial software, if you make a mistake in a tax software, it's a huge deal. Especially in TDS because one TDS return may have thousands of people. And one mistake will lead to so many people suffering. So yeah, that is a huge, huge requirement. The accuracy is number one. The problem with accuracy here is that the TDS return format that is used to file a return with the government is a sort of very old arcane file format. Like sort of from the mainframe days of programming. So it's like a flat file format with a lot of weird inconsistencies. We'll go into that. And it's also not very well specified or well documented. So the next requirement is flexibility because it's a quarterly cadence. Every quarter you have to do a new return filing and the rules typically change. They will have some new sections added new rules added data format changes over time. So and this is also very critical because at least back then every quarter they would announce a new file format or a new changes to the file format. And it would be just immediately applicable. Okay. It is like it is released on Monday and applicable from Monday. You have to add support as soon as possible. So that was a huge, huge problem. And finally, the other need we had was since this was the second product we were building, we were not able to, you know, keep it as a full time focus for everyone involved. We had very few people. We had to move between products. So like after the initial sort of launch phase for a long period of time, it had like a quarterly sort of wake up. Okay. Next quarter is coming in. You have to grab whatever changes, go into the code, make the relevant changes, do it correctly and get out. So it was a product that needs something to be very simple to be able to get the context back into the system. If it is very complicated in nature, then you wouldn't spend some time, maybe a week just understanding what you had done last quarter. So lack of engineering resources, like number of people, lack of time, all of these are on the constraints we had. So the single largest constraint was the file format. So I've actually put a screenshot of the file format here. It's a text-based format. It has different types of lines. Each line has some mode. Each mode has different meanings. The meaning could change based on the time in the sense that for which quarter this return is, or which type of return it is, salary return, non-salary return and so on. And correction returns also have different formats. So it's a very weird format. And so the way they update the format also is like they had extra fields in the original format specification. Whenever new fields are added, they'll use an extra field is now meaning this. And if there are not extra fields, then some of the old fields that are no longer needed, they may replace that with the new one and so on. Since number of fields cannot change. So yeah, this is the format. So it was the sort of main blocker for us because we wanted to be able to do this very accurately. It is not something you can make a mistake on. And we tried a lot of different things to figure out what is the good option for this. Like we tried using very sort of procedural type code to read it and write it. But that was getting complicated. We tried to do DSLs, but like we didn't have really time to actually invest in this. We tried to use UI based mapping tools, but tools on top of the format. But again, it was not working out very well while doing this. I actually came across a feature of F shop called type providers and which really, really sort of helped me at that time. So okay type providers. I think our future that is F shop specific right now know the language has this as far as I know. So it's a it's a very interesting sort of way of metaprogramming at compile time. You give the compiler a sample of some data format. So let's say it is a Jason format or XML or CSV. And you have a type provider for that specific type of format. In the case of us, it was like a CSV file for that. So you have a type provider which understands what CSV files are what delimiters and so on are. You give it a specific example. This is a CSV file. I want to read it will add compile time. It will look at this data. It will generate types around it saying, oh, this CSV file has five columns. This is a date. This is a string. This is a number and so on. It will create a type around it automatically. And it would basically also give you parsing for free in the sense that it will automatically grab the field names and everything from the header and generate a type. So one second, I'll just do a quick demo of this because it's a very, very interesting feature. So one second. Can everyone see this? Okay. Okay. So I'm right now doing this in visual studio. Don't get alarm. Okay. So this is a F sharp interactive script. I can basically write any code over here and I can send it to the interpreter, which it will evaluate and put it over here. This I think is small. Can anyone? Okay. All right. One second. Let's see if it is required. Okay. So I've just done some setup over here. Imported the sort of library for a Jason provider. What I want to do is there is this sample file I have, which is a, which is a GitHub repositories. Jason, like if you hit the GitHub API for a single repository, this is the format that will come back. So it is sort of a nested structure with a lot of information. This is for the home group project. So it is nested in the sense that you have owner as a nested object. You have a lot of these things. And then you have some other nested objects again. So if you are going to build a GitHub client, for example, you need to support this format. You'll traditional approach would be you write this by hand, you write a class and then it converts to this and so on. And you annotate with the field name and everything. Okay. So what I'm doing over here is I'm just saying that this GitHub provider is a Jason provider of this. Sample file. So I'm giving it the part to the sample file I have and this path can actually be a URL. You can actually hit a remote URL and grab a sample at compile. So, so, so the type provider also gives you some convenience methods like from the sample data. It can give you the data back just to see what it is. So I'm getting the sample data back from this type provider. It is a fully typed object. So I can actually look at the fields inside the Jason and even the nested fields are properly mapped into a object. So, so if I evaluate this shortcut was not working any, the keyboard shortcut was not working. It worked now. So, so from the sample, I can get that URL back. But I can also load a new instance of this. So for now, I'm just taking a text file. I'm just reading it into a string right now. So this one is a different file. This is for the F sharp project. Okay. So I'm reading this second Jason and I'm just giving it to the parser. And so if I do this, the name over here is the shop. So it basically took any other instance of this type of Jason and past it into the proper fully typed object. And one very interesting implication of this is you can use this further in your application. Let's say that tomorrow GitHub's API specification changes. Something changes. So let me go to the sample. Let me just change on owner to author. Okay. So I've changed the sample find. GitHub has changed the specification for some reason. So when I reevaluate this, I say, let me probably restart the interpreter. Correct. Correct. It's doing the right thing. So the, what would happen is your code compilation would fail. So if the, if you're using the old name and you recompile it, it will give you a compilation warning wherever it was used throughout the application. So changing formats will give you compiler will directly say, okay, these five places are very using the old name and you go and change them. So yeah, this was a CSV provider, but there are built-in providers for like CSV, XML, Jason, Excel files, a lot of different data types. There is even providers for SQL databases and so on. So okay. So it actually simplified a passing a lot because I could use that official documentation had some format. I could use that specification and put it in and I could map it to my model very easily in the code. I could actually see the exact name that is defined in the format so I can trace it clearly. And the code readability was also great in this case. So we build this, the file handling part in a shop. We tested it a lot. We had a simple strategy. You take sample files from some other software or government software, you put it into our system, parse it, parse data, you generate it, do a line-by-line comparison, field-by-field comparison, see what fields differ and you go back and fix it. So it was a very sort of iterative approach and work very well. A lot of this was automated with F sharp. So the initial goal was to use F sharp mainly for this data part handling because we found a great tool for it. But as we started working on it, we really liked the language and it was working really well for our product. Problem domain. So we ended up writing the whole product in F sharp at that time. We didn't really have a focus of like making it a functional application or something like that. We were more pragmatic. We just wanted to get it done. F sharp gives you a lot of nice benefits because it is like you can use it at any level you want. You can use it as a nicer version of C sharp if you want or you can use it as a very high level functional programming language depending on what systems you use. So the end application sort of was core components like the parsing, the validations, a lot of these business rules were written in F sharp. Top level mostly was again written in F sharp, but it was more of a standard imperative style, controller actions and so on. All the blue logic was more imperative. So yeah, this is sort of the philosophy we had with F sharp. Be pragmatic. You are learning this language. You don't know it completely. So use whatever parts you know well, use them and try to get leverage wherever you can. But also like if you feel that there is a specific area where you can invest time and learn and use that for greater leverage later. Do that. So yeah, like it's you can't really expect to learn a language very quickly. Right. So our release was very tight. We had like six to eight weeks to launch, build the product launch. So it was a very focused execution period. So we learned specific parts of the language and use them. And over time, like we have actually gone back and changed some things which were not great, not well done. So mostly when we started out with F sharp, we use the basics like pattern matching, currying pipelines and so on. So I'll just give you a very, very short introduction about these things in case you're not familiar. So the pipeline operator in F sharp is actually a very simple operator. Its definition is as simple as pipeline of X and function X is the data is function applied with the data. So it sort of turns your code into a something like a unit pipeline. You're giving data in the left, passing it to the function, passing it to the next function and so on. So you can arbitrarily, you can have a very sort of long pipeline of like three, four operations like over here. And it just feels very natural. It's very easy to read. And for our business domain, especially it was very well suited for because there were actually multiple stages of operations we had to do in sequence. The pattern matching again, F sharp pattern matching is very powerful, especially because you can match on multiple values. You can match on a couple of values. So if you have listed conditions, if this do this, then look at other variable, look at some other variable, you have three top level variables. You can put everything in a single pattern match object and flatten it really into sort of a nicely readable decision tree almost. We might have gone a bit over, but like even single case, it tells whatever we ended up writing match everywhere. So, but yeah, it was a very, very useful feature for us. And so as I was learning the language and building the product, I realized that partial application is actually a very, very nice way to encapsulate logic from one layer to another. So I can give you an example here that, okay, let's say that you want to do some validations. Validations are dependent on, in this case, validation requires you to specify your quarter return type and the deduction. But at a high level, when I'm looking at it from a top level view, I just want to make, you know, for my UI, I want to give a function that says, okay, take this deduction, validate it. So I can freeze in the, you know, context dependent variables here, quarter and so on. I can give it a specific version. I can get a function which is just going to take a tag deduction and validate that. So this was very useful for like, okay, you have some low level code which is doing very specific things. At the top, if you want a generic type signature or something like that, you just give whatever you want to make it more general. The order of the parameters and everything really makes a difference though. So not sure if this is readable for everyone, but we also ended up like using very simple data structures to encode very complex rules for the, in this case, it was for the UI. So for the software, there were different modes of operation, different tools. If this field is editable, if the return is in this mode, otherwise it is not editable. Sometimes it is read only. Sometimes it is invisible. Sometimes it is hidden and so on. So we were able to just like write a UI spec in a very simple manner. So I'll just quickly run through this. Like at the top, some type declarations. A column specification is an expression and a function which says whether the column is visible or not function which says whether the column is editable or not. And these things can be multiple features because there could be multiple rules on top of it. So at the end, I can actually see like, okay, for a UI, when I'm looking at a date field, the rule is for the rule for visibility is show it always. So show the date always and edit it always. But for some other field like session code, show it only for revised returns and only edit if it is null and so on. So I could compose different conditions, put them very easily into a data structure like this and have some other layer, which is interpreting this data structure and creating the actual UI specification. So it's given me a separation between the rules, how what should be done from how it should be done and made it much, much simpler to implement and actually read also because everything was not very closely coupled together. So while doing the implementation, one of the key requirements of this project was that it needs to be able to handle large amount of data. And like you have people coming in with, you know, the input could be from the UI. It could be from some third party system payroll systems. It could be from Excel files or bulk uploads and so on. So you can have bulk inserts and a lot of operations happening simultaneously. So we found a very nice ORM which was actually built for C sharp, which is almost like a SQL generator. So we wrote us very small wrapper on top of it to get it working nicely with F sharp. And this is in the end like how you're doing databases. I'll give you an example over here.  So I'm giving everything as a expression over here. So this syntax where I'm this syntax where I'm putting things in the angle brackets. It's basically a expression. This is a sort of special syntax in F sharp, which actually keeps the expression tree in the memory instead of compiling it into a function. So I'm just giving a condition, which is some predicate saying name equal to this given name ordering for this equal order by clause and pagination. And given these three things, I could give it to a low level method which would generate this equal like this case. Let's start from deduction when the M equal to that and so on. So it really worked well at this level. But of course, like since you are in a very hurried schedule, there were some mistakes that we made. So I think one of the biggest mistakes we made was we didn't leverage type system of F sharp enough. So when I was learning the language, it was like the functional aspect was very, you know, very visible how to compose functions, how to use these things, but how to use types properly was actually not very obvious. So we ended up like the data model was that there was one class again using class because it was the O R M was a C sharp C sharp specific O R M, which required a class instead of a F sharp specific type. And like this high level sort of model was used throughout in the sense that for data storage for business logic for UI, it was a common model across different layers. So code was pretty simple, but it polluted. I can give you an example that since this O R M did not support F sharp specific types like discriminated unions or algebraic types, we had to use nullable values. If you're using the level values throughout a code now you are polluting it with this null. So the right thing to do would have been like separate it out into a layer and do different layers of types. But we didn't do that. That was the mistake. So that's the same. So, yeah, like if we were actually doing a more of a, if I was starting this project now, I would spend a lot more time getting the types right and doing a more layered architecture instead of having same types used throughout. Some of the issues were sort of non obvious. So in F sharp sequences, sequence step sequence type specifically are lazy. So you have a long pipeline with some eight different transformations and use it as a sequence. It's great because only if you're evaluating only three items from the sequence only three items will be used. But it's also non trivial because if you reevaluate it, if you go from the beginning again, it is going to invoke everything again. It's not going to cash or memorize the results by default. So we didn't really realize this at first and we were seeing a lot of the operations being repeated again and again. So we had to figure out like at what time do we use a sequence type or when do we use a list type. So there was a separation between sequence and list list would evaluate and give me all the output. But now it is not lazy and so on. So it was a tradeoff we have to make. We didn't really realize this at the initial stages. So one huge sort of performance issue we had that we realized after launching was we use these expression trees that had shown you for database layer and so on. Very, very extensive throughout the code because it is very useful that it is like a strongly typed expression where I can actually get the string name from that expression using some code. I can inspect this expression. I can see what nodes it connects to and so on. So for actually the generation of the file, the final TDA certain file, I was using one expression per field, per line. So this was working well for simple smaller use cases, but that these expression piece are actually pretty, pretty expensive to build. So they are like, I think last I've seen was like few hundred times lower than creating a normal lambda function. So when we were actually testing this and figuring out the use usage, the profile I said 99.99% time is being spent only building these expression trees and evaluating them. So we actually removed it out from that, from that part. Instead of expression trees, we use something else to get like 100% improvement in the code base. So, but the profiler actually help us because we would not have realized this is the case without using a profiler. So this is also sort of minor problem that we had to figure out which data structures to use. F sharp works on the CLR. It has its own sort of parallel data structures though. So a list in F sharp is a different is different from a list in C sharp F sharp implement sort of a immutability. Data structure and it's a linked list and C shops lists are different. They are realists different namespace different classes. So main issue was that like again, third party libraries would expect a C sharp type. Then you have to convert from F sharp to C sharp. And again, it's also since a list was used throughout the code base and it's a linked list. Some types of operations were much lower. So wherever required, we had to replace with an array or some other type. So yeah, we had tooling issues also. So this was back in 2014. The story is actually much nicer now. But like visual studio, we were using windows and visual studio for developing this. The support for F sharp in visual studio is not as great as C sharp. It is lower. It crashes. Sometimes it hangs up. One very interesting thing is F sharp projects do not allow cyclic dependencies. So the order in which you include files in the project matters. You can't, you know, if you have file A and file B, you can't refer file D from file A. You can refer only in the order they appear. That actually is a very nice feature because any time you open F sharp project, you can read through it in sequence and you can understand it completely instead of like jumping back and forth. And it makes the dependencies very clear. This is a dependency of this and so on. But visual studio, for example, did not have an option for adding a file at a specific item. Every time you could add an item at the end. So we actually had to manually hand edit the project files and put it up and down and so on. So, so yeah, the, like the F sharp tooling has improved in visual studio. And there is also much better tooling now for non windows users. So you have atom and visual studio code and you have sort of cross platform support for it. But it's still like it's still not as good as the story you would have for ID on C sharp or Java. Maybe it's getting there, but it's not as great. So, but very interesting. It's case you were always hitting into us, like F sharp compiler versions would update and we often had this case. Can you write some code which works locally, you know, give it to a production box. It fails and it was very, very annoying to figure out what is the cause. And usually ended up being a compiler version mismatch initial versions. So for most of Microsoft's, you know, tooling, originally what used to happen was that when you install a runtime, it would install at the global sort of system level. They will move to a local sort of package dependency thing. But again, it becomes sort of little complicated to manage sometimes. So yeah, we run in, you should run into this problem a lot earlier, better now. So, okay, as we started using the language, we figured out like different, different tools that the language gives us to actually write code in a better way. So one other interesting feature of F sharp is something that it calls computation expressions, which is sort of a syntactic sugar for monads. And I'm not going to go into detail there. So it's basically like when you define a computation expression, you define bind and return to operations. And this, the sort of compiler translates it to a different syntax internally when it runs. So I can actually just explain with example. So over here, this maybe you see is a computation expression. So maybe it's not a built-in expression. It's a thing that we build ourselves. But it's like everyone ends up writing this, takes this from Stack Overflow or somewhere and puts it in the code base in the end. So what this code basically does is I want to calculate the late find for some TDS if you've not done it on time. But you can only get the late find if both dates are present and both dates may not be present. They are option types. So credit date and TDS date. If they're not present, I can't get a late find calculation. Otherwise I can. So what this does is inside the maybe whenever I call this let exclamation, if that right inside is none, it will fail at that point and it will return none at the top. So late find also is an option at the end. It has some value or none. So this is basically almost the same as writing this.  Otherwise again, go into it and so on. So this is much more harder to read. It is also very annoying to write. This is much simpler. And it can go to any level basically. You have four variables which are optional. So this actually was very useful for our top level glue code for controller level things where I'm getting data from parameters or from some data sources and deciding what to do. So this actually was great. But again, it without we used to have like a lot of nested conditions inside the controller. Because because like F shop will force you to pattern match on something if you don't cover all the cases. So if you have nested things, it would end up being like that. So we ended up flattening parts of it, wherever suitable. So this was also very interesting learning over time as you matured with the language, the compiler is very smart. So it can do type inference and you don't need to actually specify types. It will be able to figure out here. This is the function that is adding two integers. So we didn't really, you know, annotate functions with types often initially. But as we started working on it over time, we realized that the type hints or the type annotations that we give actually better suited for just reading it back. When you go back to that code after a few months, if you have annotated with the types properly, it's easier to understand what it does. Otherwise, like you have to go to the ID mouse over it and see what it means and so on. So we have started putting the annotations in manually. Also, we started doing type aliases, which is basically like, let's say I'm taking this combination often, like few things together in some double. So I can actually define a annotation that says this type is equal to this combination of types. And it's much easier to talk about column specifications than saying this verbose thing. So yeah, another like another regret I have is that we didn't really use the algebraic types, the union types well. So we mostly ended up at very leaf level in the data structure. Finally, this is either nullable or not or something like that. But we could have used or leverage the union types at a higher level, but mostly it was used at the leaf level. So yeah, this is something that we could have used better. So okay. One very interesting insight is that we initially assumed that like getting people to work with F sharp would be hard, but it's actually not the case. We have three people working on this product right now. One person has some prior Haskell experience. One person has worked mainly with just one is a college pressure and everyone sort of ramped up and was able to contribute to the product very quickly. In-depth understanding will take some time, but it's actually a much it's actually a very easy language to learn and understand. And I'm really, you know, glad that someone learned F sharp as the first language to work with. Okay, so finally, like it's regardless of what language you use, it ends up being that the way you structure the application really matters. The design of the application matters. So regardless of what language you use, you can write a bad application in F sharp and write a very good application in C. So like good design is always going to be useful and that was independent of language. And wherever we sort of made shortcuts or took shortcuts, even in the F sharp project, finally we had to go and fix them. But functional languages will help you make right choices around the way because they give you more tools. They have all these double types and discriminative types and so on. So when we started the, again, most of the libraries we are using were C sharp specific libraries since F sharp was still very young. But now it's actually a different situation. There are projects which use F sharp as the first class citizen. And you don't really need to make some of the sub optimal choices view we made earlier. Now there are F sharp specific warms and a lot of these things available at present. Okay, so right now F sharp is being used. The whole TDS product was completely built in F sharp and inside clearbacks. Also some features are running on F sharp. Most of it is still C sharp because you're not able to basically it's cooling issue. We couldn't mix and match two languages in the same project inside. So it was either like rewrite everything into a new language or continue working on the same. So it's not really a huge win. But like some of the other interesting things we did with F sharp was there is like a canopy, which is a DSL overselling name. You are able to write browser tests very easily in F sharp. So yeah, that's it. Any questions actually using the CSU type provider because CSU provider I can just say use carrot as a separator. Number of fields was different and we had to figure out the type. So first we had a layer on top saying if this is of some type go go to this provider and so on. So we had the logic at the top layer which would distribute across the type providers and you can actually provide the hints to the type provider. At least in the CSU provider, the file headers you can put a hint saying that this is supposed to be a string or this is supposed to be a int and it will try to coerce it to that. Yes, but again, like if it can't pass it, you probably want to take it as a string. And because you don't know which format it's going to use in the end. MMD by DDM by ISO format and so on. So like these three people are working on this project full time. The whole engineering deep right now is around 16 people. We have like clear taxes mostly C sharp and some of the projects are Java. So it's yeah. So initially like mostly it was a server side rendered application. But all the grud aspects were being taken over by JavaScript. It was like a grid based interface something like Excel because it is huge amount of data. We don't want to create one by one entry. So we had a JavaScript library in the front end which would render it in a grid and communication was like Jason. So this is on the. So when I when I evaluate this with a given year given quarter given TDS written type as a input, I will get a Jason specification. There was a separate layer which was just going over this running these things and getting a specification for the UI. So it's a function. So show always is a function which would take in some specification year quarter and so on and return. Correct. So just like editing, for example, I actually give some example edit always is function takes a deduction returns to all this. So it was going to. So there was a separate layer which would go through this data structure call the functions one by one. And like there would be if there are multiple functions, it would take a combination. This is being done the server side server side would evaluate this for a specific instance. If you're working on 2016 quarter three something, then it would evaluate this figure out what is what is required and create a Jason specification as output. Jason specification will be used by the front end to actually create the fields. So so we still don't use types as well as I want because it would require spending time rewriting the large parts of the application. So it's a gradual process. Still, it's not that difficult, but for the longest time, basically it was not a product which had fixed people working on it. Only recently we have now three people working on it for the longest time it was we were focusing on clear tax, the filing product. And then on this once in a quarter and so on. So it was like if we had time and resources, we would have made a lot of changes. But by now we have people working on it full time. So we are actually seeing a cost rate of improvement every quarter. So every quarter every three months it would change. Sometimes the changes are very small in the sense that one field is added or some field is marked optional. Sometimes it's like very big changes. This type is no longer allowed and we are using this and so on. Every quarter it can be toss whether it is a small change or a big change. So the government would release the sort of thing in the Excel file format. This is Excel which contains all the fields and so on. So you would take that, put it in the sample specification and when you compile it will tell you where it is breaking. Additional fields at least yeah but existing fields if they are removed they will be automatically highlighted. Additional fields you have to add yourself yes. So we don't really need to maintain history because once the government goes to a new version they will also stop supporting old versions. So in this case it was we didn't need to maintain versions of it. No, like in not the actual statements. The data yes but not the statements like one quarter. So Abhirajan is also from my team. You can actually chat with him later if you want. Any questions? So we didn't ship a bug in the file parsing which I'm very happy with. So that is the main thing. Like in the sort of new layers or whatever UI states and sort of that type of messy code we have ship bugs. Yes and but not seen a huge amount of difference at that layer but in the core business logic it is definitely helped. Anyone else? How are they different from? So let me see if I can just show it here. So this is a very simple lambda function. Add is a function which takes two integers and returns a sum. If I do so this guy is an expression. It is a quotation of expression of this expression. So using this I can actually probably need to import some. So the type of add is a function which is going to take integer return function which takes integer and returns. This one is a quotation expression of that same type. So I can invoke it but I can also go inside the expression tree and I can see the nodes, the expression nodes and I can go into it and see. So the whole expression tree is available at runtime. You can go into it and see what is there. It runs on the CLR and CLR will keep the generic type function. Yes, otherwise this is a compiled unit goes into the it made things nicer. Like I was able to write very readable code. So we use that we didn't realize the cost. So when we saw it is so slow, we had to remove it and user. So mostly when you have an expression like this, right? Typically what we ended up doing was let's say you have a type get a provider or something. Type anyway, we mostly ended up using expression tree as an accessor in the sense that given an object, give me some property of that object. So using that basically I can get the when I evaluate this expression or go into it. I can get this length property as a string. I can get that name back. So for generating SQL or mapping to JSON or something like that, you can take that name of that expression name of the property and use it somewhere else. And you get the benefit of static type thing over here. You as well as at one time you get the actual sort of name. So it's similar to reflection almost in our use case, but you can do a lot of things. You can actually build these expressions at runtime also. You can compose or create the expression tree at runtime. You can evaluate it and so on. That's right. Let me verify. I'm not 100% sure. There is a, there is a package I have to import which gives me a way to invoke. Can't remember system dot runtime dot something Microsoft. I can remember something can't remember it. All right. So I think we are done with the questions. We can catch up outside also and go go go go anything in detail you guys want. All right. So thanks a lot. Yeah. So yeah, you can reach me on Twitter if you want or email and that he attacks. All right.