Skip to content

uses of right arrow

seanhalle edited this page May 25, 2019 · 1 revision

In this use, "=>" is just syntax saying particular pattern on one side, and what the case statement returns on the other side:

In this use, "=>" has two different meanings. In one, it declares type, in the other it creates an instance of a function, while implicitly declares the type.

In this use, "=>" implicitly defines a function that is applied to every element of a list (or collection -- IE thing map is invoked on inherits Iterator). The "=>" has on its left side a variable that represents each element of the list. On its right side, is an operation performed on that element of the list. The result is a new list with the same number of elements, where each is the result of the operation on the right side of "=>".

Clone this wiki locally
You can’t perform that action at this time.