📜 ⬆️ ⬇️

One of the possible applications of the Y-combinator

Idea. And let's send the Y-combinator to the input ... not the Y-combinator himself, but almost Y. Y-stroke, not even a combinator, but simply a function that does not have a way out of recursion.

I know that they would do it 100 times, and nothing good except STACK_OVERFLOW_EXCEPTION came out.

Let it take a state as input, input and output information, and send the state further.
 Y functor data = functor (\ newdata -> Y functor newdata) data

 Yscratch callback state =
     // cross knowledge with input
     let new-state = intersect state (input ()) in
         output state
         // simplify knowledge if possible
         callback (reduce state);

and now
 wtf iIdiot =
     Y Yscratch iIdiot;

What is this nafig? This is an imitation of consciousness. If state is an analogue of a neural network, then direct imitation.
')
But who cares?

Source: https://habr.com/ru/post/61283/


All Articles