> When writing a modular program to solve a problem, one first divides the problem into subproblems, then solves the subproblems, and finally combines the solutions. The ways in which one can divide up the original problem depend directly on the ways in which one can glue solutions together. Therefore, to increase one’s ability to modularize a problem conceptually, one must provide new kinds of glue in the programming language.
> Whenever a new datatype is defined, higher-order functions should be written for processing it. This makes manipulating the datatype easy, and it also localizes knowledge about the details of its repre- sentation. The best analogy with conventional programming is with extensible languages — in effect, the programming language can be extended with new control structures whenever desired.
> Since this method of evaluation runs f as little as possible, it is called “lazy evaluation”. It makes it practical to modularize a program as a generator that constructs a large number of possible answers, and a selector that chooses the appropriate one.
> We have described lazy evaluation in the context of functional languages, but surely so useful a feature should be added to nonfunctional languages — or should it? Can lazy evaluation and side-effects coexist? Unfortunately, they cannot: Adding lazy evaluation to an imperative notation is not actually impos- sible, but the combination would make the programmer’s life harder, rather than easier. Because lazy evaluation’s power depends on the programmer giving up any direct control over the order in which the parts of a program are executed, it would make programming with side effects rather difficult, because predicting in what order —or even whether— they might take place would require knowing a lot about the context in which they are embedded. Such global interdepen- dence would defeat the very modularity that —in functional languages— lazy evaluation is designed to enhance.
@l29ah > что картонный хаскелист взял хуйню в описании которой английским по белому написано что она даёт непредсказуемые результаты в мультитредовом контексте
Разбудите, когда хаскель станет выдавать ошибку компиляции на использование !Sync в многопотоке
@o01eghttps://github.com/rust-lang/rust/issues/50547 пролистал, так и не понял будет оно использовать epoll для I/O, или для того чтобы "гринтреды" работали c I/O, им нужно будет выделить по одному осёвому треду на каждый I/O "гринтред".