 so we should be okay with it. It would be a quick talk because I'm on vacation and my mind is melting anyway in Singapore weather. And I'd just like to highlight some points in recent servant development and share the enthusiasm for it because it is a project that gets me going and I'd like to share a lot. Basically, I'd like to start from why would I want to talk about a web framework at all? And first of all because it's not a framework you expect and second of all it is actually better than you expect when you hear the phrase web framework. How many of you are familiar with Servant? Michael told me there was talk a year ago on Servant. I've prepared an example recall. You can clone it and compile and run all the examples. You'll be able to get the backend, API, grad server and all the stuff I'll be mentioning later. Basically, there is a twist with Servant and the twist is we have to think of web server in other terms. We have to describe an API first and then we can derive all the useful stuff from it. This is absolute minimal example of using Servant. This is a description of API on the first line. This is a handler it's called controller in many other frameworks. This line is used to run the server itself. Why am I so excited? We can truly separate Servant with Servant because we have an API description and we have an imitation and it's all independent and we can do a lot of useful stuff with it. This is probably the most type safe web framework in Haskell. We have a unified way of bringing all together. We're using Servant network. I work in a company located in Moscow, Russia and we're using Servant. We're using servers. In Servant we use the package called ServantMock to generate mock servers to test it. We generate Ruby clients with a library. Basically each time we update an API or we build a fresh build we can check out the new API code and generate the Ruby clients and run the integration tests to see if it's still okay. If it's all green then we're good to go. We have admin interface in ESO so we kind of stick Servant on top of it as a sub-site. It is a web application so it's not radar and I'm so excited about the API description. We can see this kind of stuff pretty frequently. When we brought them through the documentation we're going to use some service we're going to use and we can describe it intuitively in programming language of our choice. This is one example. Let's imagine DSL is not real DSL from Servant. It's just one way to describe an API. We have four endpoints and you can guess the rest from its radius. You guess where you get the pass and you get the handler or the data you can get with the response. It'll make more sense on the next slides. If you're familiar with an alternative class, how many of you are familiar? Okay, I'll skip the slides. You can get the slides on my GitHub so it will be useful if you want to respect it. Basically it is a way to append some stuff together and describe how it should be used. Describe the failures scenario. We can compose an API of smaller parts. We can describe, for example, products and shopping cart on the e-commerce site. There can be two descriptions and we can stick them together in a bigger API. We can do this kind of composing and composing in Servant. There is just one twist. It's all on the type level in Servant. This is the reason I say Servant is a type-safe web framework. To grasp how it works, you have to understand how type classes work on Haskell and you have to know how data clients GST extension works. How many of you are familiar with data clients? Not much. I guess I have to leave some stuff out of the stock and ask my questions about it. I understand that you use the fact that you can put all the possible operations into Servant type in a web server type so that if you have communicating web servers then you can check their communication. You have to have the clients and scientists to describe the HTTP works. You have to have type literals to describe the pass and you can describe the types for the request and for the response in the squaring. At the first line, you can see that if you query the endpoint slash order with get HTTP verb with a request composed of a well formed JSON with order inside. Order is some arbitrary documented elsewhere data. This is a type in Haskell. We can decode the JSON data into the order type with a JSON library. Oh, I'm sorry, I'm talking rubbish. This is a response type for some reason I told you if you send get query onto the order endpoint you get an order. This fish operator we have some jokes about it I'm sorry, plenty of time so you can break or anything. What to say is you can see the verb face operator and the fish operator. I'll address them as birds and fishes from now on. This is used to append one query one endpoint to the other endpoint and the verb face is used to compose a multiple pieces of description to describe one endpoint. This is all the vocabulary you need to get the info from this type. Make any sense to you. How many of you can make some sense out of this type? I just wonder if you can come back one side. The way I decrypted it first, the alternative looking like type is what different kind of requests you can make then the order would be the path on the web server and then what happens but what is the capture from params and query params? Is it something that is obligatory in every request? This capture is specific to get request because sometimes you want to capture the query params from the URL and sometimes you want to you want to show what you have to provide to get the response you need because if you make a query all you have to do is to fire a query onto some endpoint and if you want to do something useful with a poster you usually have to provide some piece of data for it to work. It is pretty similar with put, specifically for example. You have to provide the data you want to put into the service you are using and this capture is a way of saying I want to capture this piece of data out of the URL. So what is the difference between capture and query params? Capture and query params and query Oh, so it could be like part of the par Yeah, yeah. What is confusing about that is the organization Yeah, organization Yeah, for the shipping it is very broken. I can open it and maybe it will look a bit clearer. But the main point I want to transfer across this room is we have a type that describes all the APA data you need and you have to describe it to enable you to derive all the useful info from it because Servant enables you to make many powerful things like generating clients on the go and generating for the clients in different languages you can compile data with a different compiler around with an interpreter and this is the main reason Servant have all these types for the API because we want it to infer data, not just state something. And what can we infer? First of all we can infer the types of handlers. So if we want to describe how this was request should be dealt with, we already have the type for our type checker. If we had this capture part in our API we already know that we want to provide one parameter and this parameter will be left side of the type for the handler. It will be an argument for this function. For example I'll just open it. It makes great to make any sense. If we have HTTP query with this path and we want to capture the integer from the URL, make it a little bit bigger. Sorry guys it doesn't work the way it wants. We write the handler. We want it to be this type. We want to provide some integer, probably an ID for the order we want to get and we want to return a value. It will be probably constrained by some one. So it will look like this and we can infer this type from the API description. This is what I mean by type safety inferring handler types. We can infer full classical client with servant. I'll show you the code. It is stupidly simple to do. I guess it will be easier to demonstrate with the code so I have to make a shift on a go and show you this. This is the back end I wrote and this is the API. If you have CAT shelter you can use this API to add CATs and show other things such as deleting CATs and we have four queries for this API and you can see that this is a type end point. You can see it there and we can use it as a part of the type here the whole API. We can make stuff like this which states that we want to generate a client for this API This is the API I described earlier and we want to go to this end point and we get four functions for free. Each function is a client function you can use it the right way it's all type saved and it's really to put into your process work. The client is correct write this instance. In the previous one we want to find the API and close the non-interesting direction. We can do associative stuff but what you want to say is you want to extract this part for example. I imagine you could do this write it now you have to understand everything. To make it work we want to use an instance of type class called Haserver and all these official interfaces of the stuff have the promoter representation of the appropriate instances. When you use a client generator you can better machine that and the overall world will change. If you strike something post that you add to your cat then switch back client. Can we do that? In this case I imagine something which has something at the top level and you have to drop and cat still have the knowledge like this to be straightforward because if you want to you have to remember and write you. It's perfectly possible and you can do it yourself. It's a really good question that when you work with servants you want to do it. Because then next level you have to have like a generic broad API which is very easy. It works for example you have a JSON record and it's very easy to place it. But normally in Rails it's difficult to do that. There are two types of server. So you can use the generation. The next exciting thing I want to show you is how to get a thing as a languages. Because it's different from a custom client to run. This still looks incredibly and stupid. Generate 7JS package. Right now 7.4M makes types to generate code. What I mean is when you are generating some code you need to juggle with some time to describe a CDP API. You want to get a song and to convert it into some piece of code. This is all constructed to another page. You can generate code in any language you want. A little bit later you can generate in any language you want. Not also. You can generate the same client. If you have it there like this. Where did you choose not language to query? To address four queries. It doesn't matter what language you choose. If we change the past for some reason. We have to update it in our target language. Does it make sense? The easiest way is to generate code. In the client. You need that from the API type. Use the type from the package. Write your code gen in a few hours. It's really easy to do. You have to create a file. In the file you create a file. You have to use the type. You need to run the file. You need to use the type. You need to create a file. You declare what you want, where you kind of hold the type, take a base table, or web service, and basically, during development, you have too much information. And during the runtime, it checks the time for that. OK, so the way that this is to really find the API is to keep some data, write some things on that, review it, and then leave it to me. I mean, why do we have to do this? No, but I mean, you can't do that. You can't do that. You can't do that. All right. You have to generate it from the past. You generate data, you need it, you need it. That's what you want, what you're generating. Because you generate code, you can generate for the type of runtime you describe. You have to have some data to the Japanese. Is that correct? Yeah. So it's basically something that is kind of sparring, when you are working behind the scenes. There is the service, there is my source code, I mix it up. Yeah, it's for the great integration components. This process is for the same relation, as for the spread, I tell you, I say, I tell you. I can stay at home for my fair, it won't be fair. Michael, so Michael, to do what you want to do, you have to have, you need to raise and integrate this process. You are using your own clients. For example, you have to check out the latest form of your Cascale service, and you have to build a queue that will generate all the data you need for the FSHAR part. Then you can feed it to the one-night provider, Telemate, Telemate, and you want to utilize. So that is the question, is there some possible way to get a Cascale service to provide the metadata? Yes. Yes. Yes. Yeah, well, this is already done, all you have to do is write the code to transfer it to the needs because if you want to feed some to the .NET platform, you just have to implement this part. And the data described in the API, you can already have it. You can already have it. You can have a simple basic ID type, you can have a transparent Cascale. I see your problem here. I guess it will be easier to show you how to talk. So I would like to see how many of the data is present. Okay, no problem. I'm going to use a ROOMoc server. A ROOMoc server is basically an arbitrary date to send with your own API because you have to provide arbitrary instances to generate some randomities of data. I think it's called ROOMoc. This is the initiative to generate arbitrary clients to enable plots, testing, tests, everyone wants to do business. You can generate clients, you can generate data, that will be well formed and there is no problem. So there is no need to stop you from generating servers and clients by this point. I'd like to end now and get to the part. I was going to show it initially. I was planning to move to this point right from the beginning. There are some stuff in the new server that will make you go. I want to have that. There are some lists. It's great. You can have normal authentication servers right now. It was great. You can write your own code, type your own type of code, you can write your own number to hook up in front of the server. There is no need to do it now. There is a fixed code in the upcoming server. You enable you to pass stuff like connections and configuration into that type of company that you want to utilize. It's great. If someone is planning to check out servers, definitely have a look at the master branch. It went farther the way it is right now. Of course you can wait a month or a few weeks. I don't know. It will be great. There is a foreign package where you can write your needs. You should take on foreign. We will have some minor sessions and various programs because when we use capture we have to provide the arguments because it may be provided and it may be not. So we can capture the type right now. JwT? JwT. That's what Jason was talking about. I don't really care. I don't really care about details. Let's not try to start. You can wait. I'm afraid. It is one way to implement authentication. I'm sorry. Exciting stuff. Servants were released. It is a tool that generates real information. You can ship to your partners or clients. You can generate documentation. There are guys from Moscow. The other guy is one of the servants. I'm sorry. I don't remember the name. It is great. Possible integration. I would like to see it again. There are some projects. I don't know if you understand it. It is a project by the girl. It is an attempt to capture the validation. Data validation. If you want to stream your API, it is not descriptive enough. Sometimes it is restricted by length or by regular expression. If we do this, we will be able to make something even nicer. We can have validation details throughout. This is a nice article. It was written by Andres from Veltant. It is really good. I honestly recommend it to you. You are interested. We will invite you for Moscow. Sure. You are all invited to Moscow. I would like to see some of you. I would like to be there next time. I would like to see some of you. You can contact me on Twitter or email. You can have a handgelt. What is Russian language? I am a Russian person. So, if anyone wants to make it smooth for you, that's all, that's all, sorry it's been a little messy, I hope you got at least something out of it. And the point I want to get across is you can make a new type of play on the Askel. And it is interesting to address, maybe to you if you are not doing web stuff and you can use it elsewhere. And it's just one example of it. It's really exciting. Thank you, thank you, thank you.