12.07.2015 Views

CSCE 314 Programming Languages - TAMU Computer Science ...

CSCE 314 Programming Languages - TAMU Computer Science ...

CSCE 314 Programming Languages - TAMU Computer Science ...

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Lambda ExpressionsFunctions can be constructed without naming thefunctions by using lambda expressions.λx → x+xThis nameless function takes a numberx and returns the result x+x. The symbol λ is the Greek letter lambda, and is typedat the keyboard as a backslash \. In mathematics, nameless functions are usuallydenoted using the symbol, as in x x+x. In Haskell, the use of the λ symbol for namelessfunctions comes from the lambda calculus, the theoryof functions on which Haskell is based.12

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!