Skip to content

L6: Higher-Order Functions and Lambdas

In this lesson we will explore:

  • Deep Theory: Functions as first-class citizens, function types (A) -> B, trailing lambda syntax, and performance optimization with inline, noinline, and crossinline.
  • Under the Hood: JVM heap instantiation of anonymous FunctionN objects and how inline eliminates runtime memory allocation overhead.
  • Incremental Lab (AI Chat CLI): Building a customizable message sanitization and censorship pipeline (myFilter, transformMessage) for user inputs.