Is there a typedef for functions?

>   Kotlin has lambdas with capturing, anonymous inner classes AND ability to create "functors".

Be aware that “functor” can mean two very different things:

  • In the C++ sense, it’s a lambda, like Mike said.
  • In the functional programming world, a functor is a generic type that lets you apply a certain function to all its elements and returns a container of the transformed elements (e.g. a list, a map, a tree, …).

This is going to be cool.

In one of my codebases, recently I ended up with a SAM interface that is being used in so many places.I changed it to a class with “invoke” method to make it easier to be used. I am happy with the result but having “typedef” for function (or something similar to "“type” in Haskell) would make it a lot nicer.