yCombinator method

  1. @override
LambdaBuilder yCombinator()
override

The Y combinator.

Implementation

@override
LambdaBuilder yCombinator() => LambdaBuilder.abstract(
      LambdaBuilder.apply(
        exp1: LambdaBuilder.abstract(
          LambdaBuilder.apply(
            exp1: LambdaBuilder.fromVar(name: 'f'),
            exp2: LambdaBuilder.abstract(
              LambdaBuilder.apply(
                exp1: LambdaBuilder.apply(
                  exp1: LambdaBuilder.fromVar(name: 'x'),
                  exp2: LambdaBuilder.fromVar(name: 'x'),
                ),
                exp2: LambdaBuilder.fromVar(name: 'y'),
              ),
              'y',
            ),
          ),
          'x',
        ),
        exp2: LambdaBuilder.abstract(
          LambdaBuilder.apply(
            exp1: LambdaBuilder.fromVar(name: 'f'),
            exp2: LambdaBuilder.abstract(
              LambdaBuilder.apply(
                exp1: LambdaBuilder.apply(
                  exp1: LambdaBuilder.fromVar(name: 'x'),
                  exp2: LambdaBuilder.fromVar(name: 'x'),
                ),
                exp2: LambdaBuilder.fromVar(name: 'y'),
              ),
              'y',
            ),
          ),
          'x',
        ),
      ),
      'f',
    );