What is IO monad?

  Рет қаралды 71,657

Tsoding

Tsoding

Күн бұрын

Пікірлер: 139
@AdamSchelenbergCom
@AdamSchelenbergCom 6 жыл бұрын
Trust me, I'm an engineer.
@cadebriar9921
@cadebriar9921 3 жыл бұрын
@Amos Royal yea, have been using flixzone} for years myself :)
@daytondeclan3567
@daytondeclan3567 3 жыл бұрын
@Amos Royal yup, been using Flixzone} for months myself :D
@cuadernoazul5958
@cuadernoazul5958 8 ай бұрын
Wow man you are the first content creator who really explains IO monad clearly and rigouroly without philosophical bullshit. Congrats!
@kozmicluis2552
@kozmicluis2552 6 жыл бұрын
I love it everytime I hear eye-oh monahd
@peter62709
@peter62709 5 жыл бұрын
This is the first explanation of a monad that actually made sense to me, and also the first I've come across that explained it as changing the state of the world. It seems a lot simpler now. Thank you!
@Tsoding
@Tsoding 5 жыл бұрын
This is not an explanation of a monad. This video is about the *IO* monad specifically. There are many different monads out there. And they all do different things.
@tricky2014
@tricky2014 6 жыл бұрын
You are really good at explaining things in an accessible way. Also your pacing and tone of voice is very good.
@leonardomoraes6505
@leonardomoraes6505 5 жыл бұрын
HEY, that's just state monad with the state being the outside world!
@anuraghooda8439
@anuraghooda8439 4 жыл бұрын
"RealWorld" to be precise
@DeH4er1
@DeH4er1 5 жыл бұрын
Хорошая работа, спасибо за видео!
@kahnfatman
@kahnfatman 2 жыл бұрын
THE BEST IO Monad explanation - EVER! This is PURER than gold. Btw, I love your wtf transformer.
@ivanperevezentsev7395
@ivanperevezentsev7395 5 жыл бұрын
Perfect, finally I understood the IO monad. The explanation with world transformers really makes sense.
@GerinoMorn
@GerinoMorn 3 жыл бұрын
I went from "what is IO monad" to "I probably can implement it from memory" in 30 min. The guy is amazing truly.
@Bravo-oo9vd
@Bravo-oo9vd 5 жыл бұрын
"Monad is just a monoid in the category of endofunctors, what's the problem?"
@anticipayo
@anticipayo 4 жыл бұрын
Duuuhh!
@EidosGaming
@EidosGaming 4 жыл бұрын
"You just made these words up!"
@himselfe
@himselfe 6 жыл бұрын
First 15 minutes: Hey, Haskell doesn't seem that bad! Might try learning it... Last 20 minutes: Why!? Seriously... WHY!?
@Tsoding
@Tsoding 6 жыл бұрын
IT'S A TRAP!
@yagarf9510
@yagarf9510 2 жыл бұрын
My first Haskell book just came in the mail and I’m super excited to explore the world of FP. I decided to pause the video until I learn more Haskell but I will surly come back and rewatch after playing around with Monads on my own!
@РайанКупер-э4о
@РайанКупер-э4о 3 ай бұрын
So, had you rewatch it?
@superrritschy
@superrritschy 4 жыл бұрын
Damn. This is the best explanation of IO Monad I’ve ever seen.
@sho3bum
@sho3bum 6 жыл бұрын
This is exactly how brian beckman explained monads but instead of using the world as an universal set he used monoid, this is a pretty nice example, I loved it!
@andrew_ray
@andrew_ray 5 жыл бұрын
I knew it would be `unsafePerformIo`. That weird behavior of performing side effects in the middle of printing a supposedly pure value is a classic example of the issues of `unsafePerformIo`.
@fyradur
@fyradur 4 жыл бұрын
This is one of the best videos I've ever seen, regardless of genre for the last 10 years of watching KZbin atleast 2 hours a day.
@arshadpakkali
@arshadpakkali 3 жыл бұрын
Jokes on you im watching 5 hrs a day and still confused about monad but this video actually made some things work on my brain
@cranknlesdesires
@cranknlesdesires 4 жыл бұрын
Tonight on CN9 News; Russian Hacker replements reality in program to print names, solves science in the process; are jackets really used to keep you warm or are they a Chinese marketing ploy?
@vnshngpnt
@vnshngpnt 3 жыл бұрын
Brilliant video man, very good :) It's a very interesting approach to explain monad (well, just IO monad) from a different perspective, from top to bottom so to speak, without first explaining functor and applicative. Inspires to keep learning Haskell and FP
@hansschenker
@hansschenker 4 жыл бұрын
Imperative programming is vertical: statement after statement! ≡ functional programming is horizontal: funtion -> function - - -
@EidosGaming
@EidosGaming 4 жыл бұрын
I just wanted to know about input output now I have an existential crisis on whether the world is just a state or not
@exciting-burp
@exciting-burp 2 жыл бұрын
I'm going to have to watch this 3 more times, but I this video have have been the furthest I have gotten in terms of understanding monads.
@duanwen4648
@duanwen4648 4 жыл бұрын
Dude, love your channel, please keep doing it
@Diamonddrake
@Diamonddrake 10 ай бұрын
If a pure function is a function that always returns the same result for the same input then preventing the possibility of passing the same input twice makes it effectively pure... But also… what?
@b_two
@b_two Жыл бұрын
conceptualizing side effects as a localized illusion in a pure global function is genius
@anticipayo
@anticipayo 4 жыл бұрын
A perfect Haskell program is an inEFFECTive program by definition
@juang.garcia7390
@juang.garcia7390 Жыл бұрын
Absolutely brilliant. You've won a subscriber
@Tomyb15
@Tomyb15 2 жыл бұрын
I really liked this approach to understanding the IO Monad. However, I'm a bit confused on the aspect of calling the diy monad "pure" in the abstract when we know that the function readStr doesn't always return the same result from the same input, given that what the function reads from stdin isn't part of its "inputs".
@fredoverflow
@fredoverflow 2 жыл бұрын
stdin is part of World
@christophhofer303
@christophhofer303 Жыл бұрын
Well its pure because it always returns the same thing given the same world. The „world“ is you sitting in front of the computer and typing into the console.
@redumptious2544
@redumptious2544 3 жыл бұрын
Others: Learning math from some Indian dude Me, an intellectual: Learning Monads from some slavik dude Great tutorial, thank you 👍
@IvanNIlic
@IvanNIlic 4 жыл бұрын
28:09 seconds of pure triumph (as the shit flies towards the fan) . oh, inverted World!
@gerardgauthier4876
@gerardgauthier4876 6 жыл бұрын
I thought Martin Odersky said "The IO monad does not make a function pure. It just makes it obvious that it's impure.".
@Tsoding
@Tsoding 6 жыл бұрын
For that I have only one thing to say: 6:31
@gerardgauthier4876
@gerardgauthier4876 6 жыл бұрын
@@Tsoding@ I find Haskell and Java suffer from the same problem. They take a limited(rigid) paradigm and shoehorn unlimited problems/solutions into it. A monad is a beautiful/simple design pattern that becomes 'almost' incoherent when its applied to state in a 'pure' system.
@leftaroundabout
@leftaroundabout 6 жыл бұрын
The comparison with Java doesn't fit, but you could perhaps say this about Smalltalk, which (unlike Java) is a purely-OO language. If you design the fundamental principles of a language rigidly around a paradigm, then it changes the very meaning of what “programming” is. From that point it's nonsensical to complain you can't do mutation etc., because mutation is not a concept that _can exist_ - or in Smalltalk, standalone functions aren't something that can exist. Java with OO, or F# with functional (or Scala with both!), give you a weird compromise: they are in principle imperative, but then impose restrictions on how this imperative code is supposed to be structured. “Patterns”. But that's missing the point IMO. In particular a monad is not a design pattern, it's a _property_ of some higher-order type. It turns out that the State-Of-The-World updating that needs to be done to model imperative in a pure-functional language fulfills the property of being a monad. But in an impure language, there's actually no way to prove a property like that, so F# and Scala don't have monads. (Strictly speaking, you can't prove it in Haskell either because of ⊥, but in “total Haskell” you an prove it.)
@gerardgauthier4876
@gerardgauthier4876 6 жыл бұрын
@@leftaroundabout@ I guess the jury is still out on - design pattern. en.wikipedia.org/wiki/Monad_(functional_programming)
@leftaroundabout
@leftaroundabout 6 жыл бұрын
@Gerard you should know not to quote Wikipedia as an “authorative reference”, right? Quote Eric Lippert directly. Unfortunately, he doesn't really understand monads (as variously proved online), he's just good at using _the translations of particular Haskell monads into imperative/OO languages_ - which can be pretty useful already, no doubt, but it's still little more than cargo-cult-science. What a monad really is is explained in Wiki's category theory article on the subject. en.wikipedia.org/wiki/Monad_(category_theory) This is not to say that one must understand all of that, certainly not the part about adjoint functors, to use monads. You're good if you know the monad laws and how to prove them within the pure subset of your favourite language. But you should keep in mind that there's more to monads than that.
@justinroughley151
@justinroughley151 5 жыл бұрын
Really great explanation of IO Monad - Thanks
@vorname1485
@vorname1485 3 жыл бұрын
Me being asked: "What are all those red buttons?" Me: "side effects" Me being asked: "Is the app finished? I'v started it but nothing happens" Me: "Oh, you wanted it with side effects?"
4 жыл бұрын
Now for me is completely clear... I have to study more.
@thymiosdouvis575
@thymiosdouvis575 4 жыл бұрын
"What is my name btw?" hahahaha
@DanDart
@DanDart 4 жыл бұрын
Side effects make you forget your name.
@Zorgatone
@Zorgatone 4 жыл бұрын
Name of the outro song?
@markuspfeifer8473
@markuspfeifer8473 5 жыл бұрын
What if I want to have two buttons - one button starts a lengthy operation and the other button can abort it because it takes too long? That sounds quite hard to me...
@deidyomega
@deidyomega 5 жыл бұрын
Yeah... in python, js or any oop language that's super easy... not sure about haskell though
@PacificBird
@PacificBird 2 жыл бұрын
@@deidyomega Monads in Haskell have a lot of extra functionality baked into them that allows for concurrency and stuff, so this isn't a problem.
@nekoill
@nekoill 3 жыл бұрын
Is it just me, or functional programming languages are very distinctively similar in syntax? Elixir, Clojure, Haskell, Elm as well (I think)... Only Lisp is its own beast, E-Lisp specifically.
@fredoverflow
@fredoverflow 2 жыл бұрын
Clojure is a Lisp
@valentjedi
@valentjedi 6 жыл бұрын
Surprisingly, I kinda get it and feel a bit "whoa"! Cool, really great video! Btw, I assume that underneath this nicely done illusion of a pure environment lies highly mutable conglomeration which is built in C. Otherwise, this whole thing would've consumed all memory really fast. Am I right?
@alexeykutepov3767
@alexeykutepov3767 6 жыл бұрын
I don't know the specifics of the IO implementation, but IO itself is defined in terms of something called `State# RealWorld` github.com/ghc/ghc/blob/2c959a1894311e59cd2fd469c1967491c1e488f3/libraries/ghc-prim/GHC/Types.hs#L187 the value of which occupy 0 space: stackoverflow.com/a/32673064/2951870
@sbditto85
@sbditto85 5 жыл бұрын
if you are referring to the fact that Haskell has a runtime then yes. Often people describe it as your Haskell program is a recipe that the runtime "chef" creates (runs) for you
@guidof6116
@guidof6116 4 жыл бұрын
Well, I guess changing the world wasn't that hard after all
@dvtt
@dvtt 3 жыл бұрын
Is there a link to the code ie - github?
@aziz0x00
@aziz0x00 Жыл бұрын
First time I understand it!! Thanks a ton!!!!
@joshbassett
@joshbassett 8 ай бұрын
Mind blown 🤯
@Jere1515
@Jere1515 Жыл бұрын
Thanks for the vidéo, it helps to understand better IO Monad. Is the world concept really used? Or is it just a "thought experiment"? Do you know if ZIO or IO from Cats Effect in Scala are implemented like that???
@sebastiangudino9377
@sebastiangudino9377 Жыл бұрын
In clean, yeah! But you cannot "touch" the world. And you cannot clone it either, since that's kinda the point of uniqueness typing In Haskell. The world is "There", but you cannot touch it either. The IO monad IS the world, when you input from the user for example you cannot just take the value out of the IO monad (The world). You have to keep it wrapped by the world's state. And you just send it the instructions to make a new world where your side effects will be executed. And get a new world as a result As you can see, the world is NOT accessible (We cannot touch the IO monad), which is GREAT because things are still inmutable. While also actually producing side effects by making those changes in the world manifest in your screen And of course since we don't need to access the "world". There is no reason for your computer to actually store the entire world, so the compiler optimizes it away 😉
@Jere1515
@Jere1515 Жыл бұрын
@@sebastiangudino9377 Thanks for the answer :) And what about IO executed in parallel? 😅
@sebastiangudino9377
@sebastiangudino9377 Жыл бұрын
@@Jere1515 FP is implementation dependant (So there is no "Other thread" as far a the Haskell type system is concerned). But in general each Thread would be running a function that takes an IO and returns an IO. Then a function (Like ForkIO) would make sure that, while they do happen at the same time, the world is still a just one world. And it does that by making sure the results of the functions gets "Applied" to the world in the correct order (So if for example you need to process two files at once and then concat the results and print them, haskell will make sure you are still using a function that gets the file from the world, then both files will start to process, but then when BOTH are done we will tell the world that file one is processed and a new world where ONLY that file is processed will come out, and then to that one we apply the already computed result of the other file and then we can concatenate and print them as if there was never a fork (Since we never cloned the world) ) I'm not sure if my explaination is more confusing than helpful. But I hope it helped. As far there are never two world everything will still be "inmutable" to Haskell. That makes multiprocessing in Haskell a blessing and a curse. Since there is a little bit magic going on behind the scenes that makes it kinda hard to know WHAT exactly the code is doing physically. But I guess that's kinda the point of declarative code
@arcuscerebellumus8797
@arcuscerebellumus8797 8 ай бұрын
Ok, I sorta' get the "how" (not really)... but, WHY?
@bhavyakukkar
@bhavyakukkar 4 ай бұрын
0:18
@DanDart
@DanDart 4 жыл бұрын
4:59 conspiracy
@hahas95
@hahas95 2 жыл бұрын
Thank you for this video!!!
@andreffrosa
@andreffrosa 4 ай бұрын
I think it would be cool to now explain monads but instead using an imperative language, like C.
@agcouper
@agcouper 2 ай бұрын
Check Bartosz Milewski videos, he does exactly that.
@DanDart
@DanDart 4 жыл бұрын
by 8:46 "world" has no meaning
@johannbauer2863
@johannbauer2863 5 жыл бұрын
Wow! This video is great! ^^
@junderfitting8717
@junderfitting8717 3 жыл бұрын
great video. I'm confused with "side effect", I've browsed the comments at the very bottom, but didn't get the answer.
@ea_naseer
@ea_naseer 2 жыл бұрын
side effect is something additional your function does. For example a reverse function should reverse an array but it could also change the original array. Changing the original array here would be a side effect of reversing.
@arnejarek3308
@arnejarek3308 6 жыл бұрын
keep up the good work
@LeoOno
@LeoOno 4 жыл бұрын
4:40 "you see what side effects do to you ?" lol xD very awesome video ! i'm trying to study haskell and please can you explain this part again for me? readStr :: World -> (String, World) can it be considered pure function ? i mean, i have the impression that even passing the same World, it can return different values ... am i misunderstanding something ? thanks for this amazing video :)
@nicolasmarcora9330
@nicolasmarcora9330 4 жыл бұрын
Imagine that by World you're freezing time and capturing the exact state of the world as it was at that moment. If you print "Hello!" to it you get a new World where "Hello!" was said. Now you have two Worlds, the initial one, and the one you've printed to. If you keep printing to the initial World, you wouldn't be changing it, but creating multiple new Worlds with "Hello!" printed on them. It's confusing because you know that's not how things work in the real World. But it's a nice abstraction to keep things pure within Haskell while doing useful input and output.
@LeoOno
@LeoOno 4 жыл бұрын
@@nicolasmarcora9330 first of all, thanks for your reply :D In the case of IO print, i could get the idea of 'world' + String argument returning the new 'world' with String printed to it, it's all immutable, so in this case i can see it's pure. But when it comes to IO user input, i'm still confused because i have the impression that passing 'world' as argument, it returns 'world' with some arbitrary String, so in this case how we can affirm this is pure ?
@kirill_itheo
@kirill_itheo 4 жыл бұрын
Maybe its based on the idea that By knowing the state of the world we know what the user's input is going to be.
@mrmimeisfunny
@mrmimeisfunny Жыл бұрын
@@LeoOno The World (which includes the console window) gives you the input string. An alternate world where a different string was typed will get you a different string and a different world.
@TheOlian04
@TheOlian04 6 жыл бұрын
So a monad is a pure function that takes and returns a world-state?
@Tsoding
@Tsoding 6 жыл бұрын
Yeah, I believe it's a pretty good way of thinking of it. Of course internally the actual IO is probably just a bunch of hacks, but on the outside it's a pretty good way to fit side-effects into a pure functional language. P.S. Keep in mind that we are talking specifically about IO monad. Not monads in general. There are many monads. And not all of them are about modifying real world states.
@monnef
@monnef 6 жыл бұрын
I believe monad is rather a type, which has an accompanying operator (pure function - bind) which transforms the world.
@ViktorKronvall
@ViktorKronvall 6 жыл бұрын
No, the IO monad is a monad that hides the world type which is used by the Haskell runtime similar to what was shown in this video. A monad is a much more abstract concept. A monad (in Haskell) is some data type that has three functions defined for it. Let’s call this data type `x`. The three functions are then: 1. fmap :: (a -> b) -> (x a -> x b) 2. pure :: a -> x a 3. (>>=) :: x a -> (a -> x b) -> x b What is more there are some laws that must hold for these three functions for the data type to actually be a monad. 1. fmap f . fmap g = fmap (f . g) 2. fmap id = id 3. pure x >>= f = f x 4. m >>= pure = m 5. (m >>= f) >>= g = m >>= (\x -> f x >>= g) where id is the identity function implemented as `id x = x`. It just returns what it’s passed. If you can prove those five properties you have a monad. If you are interested I can show you the proof for these properties for WorldM.
@beforth
@beforth 5 жыл бұрын
A monad is a type within a context, a function to wrap a value of the type into the context, and another function to apply a function to a value of that type inside the context. Plus in haskell you have syntactic sugar (do notation) to avoid explicit nesting of functions, so you don't have to count parens. But it's easy to mix both concepts and get confused.
@detaaditya6237
@detaaditya6237 4 жыл бұрын
You can't spell haskell without hell
@jit_rs
@jit_rs 5 жыл бұрын
Отличное видео Я не до конца понял почему тип оператора (>>=) именное такой, какой есть, но в целом очень помогло понять как пользоваться IO и как оно устроено
@expurple
@expurple Жыл бұрын
(>>=) :: m a -> (a -> m b) -> m b У нас есть две функции трансформации мира, которые мы хотим скомпоновать: `m a` и `m b`. Помимо собственно трансформации мира, эти функции ещё потенциально возвращают некоторые значения `a` и `b`. Скомпонованная функция будет возвращать последнее значение в цепочке, поэтому у финального результата тип `m b`. Тип `a -> m b` возникает из-за того, что у нас вторая трансформация может _зависеть_ от результата первой. Здесь например второй >>= компонует `readLn :: IO String` и `case :: IO ()`, значение которого зависит от name (результата readLn): whatIsYourBranchName :: IO () whatIsYourBranchName = putStrLn "What is your name?" >>= \_ -> readLn >>= ame -> case name of "Alexey" -> putStrLn ("I love you, " ++ name) _ -> putStrLn ("I hate you, " ++ name)
@expurple
@expurple Жыл бұрын
For English speakers: here I'm explaining the signature of >>=. In case you're interested, my comment seems to be Google-translatable just fine
@AlexLexus42
@AlexLexus42 2 жыл бұрын
Круто! Знаю что ты забросил писать на хаскеле, но я уверен, многие бы хотели увидеть haskell стримы от тебя!
@AdamSchelenbergCom
@AdamSchelenbergCom 6 жыл бұрын
If you draw a monad how it would look like?
@softwareminimalist
@softwareminimalist 6 жыл бұрын
Like a railway :)
@Pradeep1989
@Pradeep1989 6 жыл бұрын
@@NazariiBardiuk Thanks for sharing this link. This is super useful.
@gbcr09
@gbcr09 5 жыл бұрын
Great video!
@0xlkda
@0xlkda 2 жыл бұрын
Im still not get it.
@TRex-fu7bt
@TRex-fu7bt Жыл бұрын
I want that color scheme. That yellow pops.
@bhavyakukkar
@bhavyakukkar 4 ай бұрын
Gruber darker (emacs theme is on his github and people have also ported it to vim/vscode)
@aziz0x00
@aziz0x00 Жыл бұрын
Haskell is just so amazing ❤
@freaking1122
@freaking1122 3 жыл бұрын
Well explained!
@niikurasu2855
@niikurasu2855 2 жыл бұрын
Bro lives in the backrooms
@rnoro
@rnoro 11 ай бұрын
What stops you making videos? It's a shame there is no update in this channel XD
@bhavyakukkar
@bhavyakukkar 6 ай бұрын
he uploads videos very often on his other channel (most of which are vods of 2-3 hr streams where he implements a new idea in whatever language)
@mechmaker9346
@mechmaker9346 5 жыл бұрын
Very good video! About unsafePerformIO: 1.it,s bad,because haskell hasn't got stability in evaluation,and monads is only thing,which helps you. 2.It,s not declarative,to have dirty code in pure,it brings imperative order in declarative code.
@nathaaaaaa
@nathaaaaaa 5 жыл бұрын
Nah, I dont wanna learn relativity now
@vertie2090
@vertie2090 4 жыл бұрын
No hello world in Haskell for you then ¯\_(ツ)_/¯
@sidjoosin6549
@sidjoosin6549 5 жыл бұрын
input and output - are not "side effect" . if your your function takes arguments and prints them on screen, like printf() or console.log() , this is not "side effect" of this functions, this is pretty strait effect, theese functions are made for output some args. Side effect - is when your function "add()" write something on screen, or return to the world something, but sum of args
@deidyomega
@deidyomega 5 жыл бұрын
io is def a side effect
@sidjoosin6549
@sidjoosin6549 5 жыл бұрын
@@deidyomega so function without io is pure? i think answer is obvious. there is no function in the world that don't takes input and don't returns output, who gives input args -- another fntion or user -- inside the function it is no difference. as well as it is no difference where it returned value -- to another fn or to your screen, or both
@deidyomega
@deidyomega 5 жыл бұрын
​@@sidjoosin6549 You can take an input and return an output without using print (or equivant) python example: def pure_add(a, b): return a+b def inpure_add(a, b): print(a+b)
@Bravo-oo9vd
@Bravo-oo9vd 5 жыл бұрын
I think that "a side effect is something that a function doesn't say it's doing" might be a good way to put it
@xdman2956
@xdman2956 Жыл бұрын
28:43 Why did it print "(()" before "What is your name" ? btw great vid, Im the happiest one could be after filling in the >>>= return type and body myself despite not having written no haskell ever :) .* It is unreasonable how transferrable are some math skills to writing in a language I only saw type definitions in beforehand. (Well, being freshly after kzbin.info/www/bejne/m2fXiH16atZrq9k helped with the monad return type and knowing what was going on - that we were writing flatmap :) Gosh, this 2-vid combo is the greatest to understand the topic in detail, if you know/broke your head for a while over what monad is, but without type definitions beforehand (all the "adding logging to functions" is a monad, "Option" is a monad like in this vid: kzbin.info/www/bejne/eWPaZWinh8hml7c and some by A Byte of Code). *Well, gotta admit I wrote composition explicitly as w->uncurry(f)(wt(w)) instead of uncurry(f) . wt (which I hope is too - syntactically, I mean). I could've thought of composition after the vid I mentioned and in general if I was more aware that it has to be in this language, but before you wrote it in its symbol could be ∘ for all I knew :)
@xdman2956
@xdman2956 Жыл бұрын
Oh, I think I see. I stopped immediatetly when I saw it, and then also expressed my gratitude. Turns out is not so mysterious just a few seconds later
@DjLeonSKennedy
@DjLeonSKennedy 5 жыл бұрын
Жестко
@WomboBraker
@WomboBraker Жыл бұрын
difficulty to write actually useful programs with fp paradigm is long lasting major problem hahahahahaha
@yungclump
@yungclump 2 жыл бұрын
Seen.
@goosygoose2517
@goosygoose2517 6 жыл бұрын
I made a snippet pastebin.com/z6GHKL8F. How the returned value from printStr (World) is the new state of the world. It is the same data constructor that was passed as an argument to the function. It's the same value, - World. And if you meant that every time you write data constructor World you get a different World (in that instance of time let's say), then that value (World) in itself is not pure and is against what a value is. 5 = 5. World = World.
@Tsoding
@Tsoding 6 жыл бұрын
I lied
@GerinoMorn
@GerinoMorn 3 жыл бұрын
Why am I not surprised that the best Haskell tutorial I've ever seen is done by a Slavic brother... Amazing job!
@SolathPrime
@SolathPrime Жыл бұрын
branchWorld :: World -> (World, World) I've tried the same thing in python it's behaviour is undefined
@sh_zik
@sh_zik 4 жыл бұрын
World changese in time so....
@ethanpaulmorgan5123
@ethanpaulmorgan5123 6 жыл бұрын
Dad
@first-thoughtgiver-of-will2456
@first-thoughtgiver-of-will2456 3 ай бұрын
In Rust functions are third world citizens (Fn FnOnce FnMut)
@Chemaclass
@Chemaclass 4 жыл бұрын
So easy going hahaha
@venustheplanet8208
@venustheplanet8208 3 жыл бұрын
I wuv yu
@androth1502
@androth1502 5 жыл бұрын
i'll go with "you just switch to a good language."
@boku00
@boku00 4 жыл бұрын
This is so illegal.
@nincako
@nincako 5 ай бұрын
What is side effect? Since it is not stated, I am stopping this explanation. downvote!
@SteinGauslaaStrindhaug
@SteinGauslaaStrindhaug 4 жыл бұрын
This seems rather perverse...
@tahamagdy4932
@tahamagdy4932 5 жыл бұрын
Emacs Craches! Try Vim :D
@jlf1964
@jlf1964 4 жыл бұрын
masturbation intellectuelle
Making Music with Haskell From Scratch
49:02
Tsoding
Рет қаралды 101 М.
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
What is a Monad? - Computerphile
21:50
Computerphile
Рет қаралды 611 М.
Creating Your Own Programming Language - Computerphile
21:15
Computerphile
Рет қаралды 193 М.
Haskell for JavaScript programmers
16:51
Tsoding
Рет қаралды 59 М.
What the Heck Are Monads?!
21:08
ArjanCodes
Рет қаралды 76 М.
Brian Beckman: Don't fear the Monad
1:07:10
jasonofthel33t
Рет қаралды 402 М.
Okay but WTF is a MONAD?????? #SoME2
18:18
TheSTEMGamer
Рет қаралды 68 М.
The Making of an IO - Daniel Spiewak
55:32
ScalaIO FR
Рет қаралды 27 М.
What is a Monad? - The Last Monad Intro You'll Ever Need
15:48
走歪的工程師James
Рет қаралды 25 М.
Secret Haskell Composition Technique
26:44
Tsoding
Рет қаралды 23 М.
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН