@NET
  • Blog
  • Mentoring
Subscribe
HackerRank Functional Challenges

HR F#: Lambda Calculus - Evaluating Expressions #4

  • Alex Netkachov

Alex Netkachov

Sep 22, 2017 • 1 min read

This problem just checks how well you have got the idea of Church encoding while solving the previous problem.

Compute the value of λx.λy.x(xy).

Just by looking at the definition of the Church numerals it is easy to see that this function corresponds to number 2. And this is the right answer.

Sign up for more like this.

Enter your email
Subscribe
Performance comparison of the solutions for passing byte arrays from .NET runtime to JavaScript in Blazor wasm

Performance comparison of the solutions for passing byte arrays from .NET runtime to JavaScript in Blazor wasm

OverviewPassing data from and to the JavaScript environment is one of the common tasks developers need to solve while working on a WebAssembly application with Blazor. Although typical use cases are well-covered by the JSInterop classes (e.g. IJSRuntime), less common problems require putting some effort into finding the right

  • Alex Netkachov
Alex Netkachov Jun 20, 2021 • 4 min read
The function Map()

The function Map()

Today I would like to share last of small helper functions that help write concise code. Just like Apply, it helps to avoid null-checking ifs by conditionally applying a transformation function. Differently from Apply, it returns the result of the transformation, which, apparently, is quite a frequently used pattern. Let's

  • Alex Netkachov
Alex Netkachov Oct 30, 2020 • 3 min read
The function Try()

The function Try()

I've recently posted about two functions that I use sometimes to write less code: Void and Apply. Today I would like to share another one of the kind, a function that helps shortening try/catch statements. Consider the typical try/catch statement: try { session.Check(); Console.Error.WiteLine("OK"); } catch

  • Alex Netkachov
Alex Netkachov Oct 23, 2020 • 1 min read
@NET © 2021
Powered by Ghost