Автор: Claudia Alves, mEm lnc, Moaml Mohmmed
Издательство: Amazon
Год: 2020
Формат: azw3/pdf(conv.)
Страниц: 274
Размер: 1.1 Mb
Язык: English
A balance of flexible and inflexible qualities make Haskell a fascinating programming language to learn and use.
First, the Haskell programming language is not named after Eddie Haskell, the sneaky double-dealing neighbor kid in the ancient TV sitcom, Leave It To Beaver.
Haskell is named after Haskell Brooks Curry, an American mathematician and logician. If you don't know, logicians create models to describe and define human reasoning, for example, problems in mathematics, computer science, and philosophy. Haskell’s main work was in combinatory logic, a notation designed to eliminate the need for variables in mathematical logic. Combinatory logic captures many key features of computation and, as a result, is useful in computer science. Haskell has three programming languages named after him: Haskell, Brooks, and Curry.
Haskell the language is built around functions, useful blocks of code that do specific tasks. They are called and used only when needed.
Another interesting feature of functional languages like Haskell: functions are treated as values like integers (numbers) and strings. You can add a function to another function the way you can add an integer to an integer, 1 + 1 or 35 + 53. Perhaps the best way to describe this quality is a spreadsheet: in a cell in the spreadsheet, you can add numbers as well as a combination of functions to work on numbers. For example, you might specify each number in cells 1-10 be added up as a sum. In Excel, at least, you also can use SUMIF to look for a pattern in cells 1-10 and, if the pattern is found, perform an action on any cells with the pattern.