 But for those that don't know and want to participate on that site, you can still register to JS Conf, to its CSS Conf, and remaining talks for DevPost Asia, it's available on the internet. So basically, on every meta, we will have on-site registration. That would be all for now. And I will return my code. So today, I'm going to talk about my recent hacking and what I'm working on, what I found for the free monad and how I could use it for testing. So what I was trying to do is making a very simple Slack bot that basically, in the channel, you could type help that listening all the comments. And I also wanted to connect to the server database to load some metrics so whenever that I want to know some that today's monitoring metrics, I could type load metrics to display some number for me. And so a simple program for that. And there's already a package for Slack bot that basically set up everything to communicate with Slack server into Slack action. So for that, and put inside the event loop to keep listening to the event from the server. And so what I'm going to do is just receiving that message and dispatch the message to its corresponding handler. So with that, I parse the comment. And if the comment is not parsable, then I just send it back for a comprehensible comment otherwise than just trying to other stuff. So with the example list, it's that's only helping load metrics. So with that type, you can wrap it into an, like, I call this bot iris. Then there are only two comment, one is help, one is load metric. And for the run, basically just dispatch on the comment. Then if it's help, then returning it back with the help comment. Otherwise, then send loading now. And calling the function to get metric, then respond it back. So then the problem is that when I want to test this, that a few of questions come into my mind. It's that it relies on a send message. And I have no control on it, that because it relies on the third party API. And in Ruby that you could use our spec that to expect the function to make sure because it's runtime system, you can make sure that the method is called. And you could return some, like, mockup response for that. And of course, then you can set up a database for, like, for testing the loading data. But that would also need some extra work on that. So with Hasco, that's, as far as I know, that is hard to stop the message passing like method call. And setting up a testing data phase would work like other imperative languages do. But that would also make some slowdown and it's a little bit drawback for me. So it could fall back to IOMona for sure. But I think in checking around on the internet, see if there is an alternative way to do that. And then I come up with an article saying that how to do it with Fremona, basically that Fremona, you can think it like into, like, AST level. Because Hasco, it's hard to understand that. So I put something to express it in JavaScript to see how the Fremona works. So for JavaScript that, say, suppose that we have a lot of comments in an array to load the string. And we could have the corresponding function with the same naming and calling into that. So in Hasco, when you could map over something, it's a functor that you have FMAF. So then with FMAF, then with a functor, there's thinking like a container, there's a structure behind it. So there would be an implicit sequence behind that. You could do it one by one. So in JavaScript that it's just set up AST, and now it says it's Visitor Pattern in imperative language. And Visitor Pattern for the Trino, AST Trino, it has an accept function and accept the visitor object that have the corresponding implementation to evaluate that AST. So with this very simple example, it just lists a sequence. So it only has to keep going to the next accept visitor object. So with visitor object, you know how to respond to the message. If the type is reply loading, then print out some reply loading for that. If it's load matrix, then print out a load matrix for that. For the walk basically, just keep walking and call back the accept. So that's on the AST level that in all terms is visitor pattern. But this structure that one by one, you could make a parallel to a monad that's composed with greater, greater than, equal to, composed then into a sequence structure. So with data type, there's a free monad package and it comes with template Haskell. So you're just writing down the comment you want to compose as the AST. So with the very simple comment sequence that I would always have the next, make it like a list on the type level. So the common tree node, AST tree node, would have the next. Then the thing would either turn out to be a help comment or load metric comment. Or I wanted to reply loading then while the user is waiting for the response. And next could be the load matrix. There's a loophole for the next could be the help. But that would rely on the parser. Then use that package. You could leave it to the free monad. Though it's a fancy net and sounds you don't know how does it work. But put it on the type level that you could see a little bit parallel here. For in Haskell that you define a list, basically it's either that empty list or that an element with the rest of the list. So in free monad that you could see that A is the element. The F3F is kind of the function behind it, the structure. And it could either be a pure function unit itself. Or that you could use a row correspond to the column here to compose them together. So then with the lift it to the free monad level, then my previous run function would be accepting a lifted monad comment and still running in the slack action. So each of them is unwrapping the monad like other monad do. Then here the still accepting other stuff like the initial version of run do. That it doesn't look much different but with extra prime symbol. But now that we could divide it like refactor this into the IO implementation level, a slack action implementation. And during testing I could interpret it in test. So for previously that all of the internal state it has to be like send message and get a lift IO that lift the IO monad into the slack action and to evaluate the AST. But now it works like a stubbing that I could use a monad state to save its output to a 2N text array, sorry, text list. Then I can just keep storing it, keep like saving the response message into a text list. Then after that I could run with x spec just test the result should be x expected. So it will run faster because it doesn't involve any external database states. And it works more like stubbing like in Ruby. So now it's my learning from this that a little bit conclusion that this though they might complicate things stuff if you don't know free monad, but if you don't understand then you could always fall back to IO monad. And free monad also incur some wrong time because it's lab associated that I read some article that there's co-density to solve that because it's basically like concatenate list. But it would like the test easier to test without resorting to IO monad. So and test it semantically and on the common level. So it doesn't have the real side effect come with the comments. And you could also see that from the implementation that it doesn't, in my opinion, it doesn't suitable for that like stubbing external survey with a lot of API. Otherwise your wrong comment would have a big bunch of lists of pattern matching. And that somehow also complicates the code. Yeah, that's it. Any questions? OK. It comes with academic paper that basically that the free means that when there's a function there always have a monad that comes with it. That is like, naming some example like function it could be a list or tree that the monad is like break it down and compose it together. Like this is like you could always walk from the first of no to the end of it. And tree you could always say like in order like there's a sequence that make how you walk with it. And that is the monad structure to serialize this stuff. So the free means that you could always derive something from the function that comes with it. And the free naming comes with that something in mathematics that's called initial. I think it's initial object for that. Yeah, I don't really understand the theory. Algebra. So free term algebra don't additional laws beyond the fact that you have certain constructors. So in case of monads, free monads means that you can always examine these constructors. Because if you could not examine them, for example, it would no longer be free, it would have additional laws. So free monads are usually used for the situation where you want to come back to the time that you constructed it and use it, for example, for debugging like this. So it will add some powers to the original filters by the form. Because in the type part of the paper, it shows that the function and then applicant and then monad and the iterator. So it's already a system for us. I just don't know where the free monad in this graph is. Yeah, so it's kind of. It's monad. It's monad. It's monad. It's monad. It's monad. It's monad. It's monad. It's monad. It's monad. It's monad. It's monad. It's monad. It's monad. I would say that the objects differ if they are constructed in a different way, in a different order. I own monad. It's not like this. So you have associative input. I think this hierarchy of type styles is somewhat irrelevant to the relationship that exists between free monad and the foundry that it is based on. So a foundry that you can turn into a free monad has to be very specially constructed to get the monad to make sense, right? You just take any foundry. Of course, you can turn it into a monad that honors the laws, but you really wouldn't make a sense of it as literally to move it. Because actually, monad colors are used all the time. Of course, since the category of monad is monad. So basically, every monad in a foundry is monad. Yeah. So whenever we construct a monad, we go back to the original kind of monad. We actually use it as applicative foundry also. So nowadays, when we define a new monad, we also have to define that it is applicative. Another question. So it's actually quite nice example of how the mathematical embedding of cascades allows you to make an elegant hand cut. Yeah, that's what I feel in this style, yeah. We can talk about it later. Yeah, yeah. I would say that naming is that pretty fancy, but actually the intuition behind that, not that... We already have a return. Not the same with others, thank you Jesus. There are a lot of names that is fancy, but yeah. Yeah. Okay. This is also present. This is all the PDF. Just open the PDF. Yeah. Okay. Let me...