TAILIEUCHUNG - Lecture Programming languages (2/e): Chapter 14a - Tucker, Noonan

Functional programming models a computational problem as a collection of mathematical functions, each with an input (domain) and a result (range) spaces. Functions interact and combine with each other using functional composition, conditionals, and recursion. Major functional programming languages are Lisp, Scheme, Haskell, and ML. Functional programming is discussed and illustrated in Chapter 14. | Programming Languages 2nd edition Tucker and Noonan Chapter 14 Functional Programming It is better to have 100 functions operate one one data structure, than 10 functions on 10 data structures. A. Perlis Contents Functions and the Lambda Calculus Scheme Expressions Expression Evaluation Lists Elementary Values Control Flow Defining Functions Let Expressions Example: Semantics of Clite Example: Symbolic Differentiation Example: Eight Queens Haskell Overview of Functional Languages They emerged in the 1960’s with Lisp Functional programming mirrors mathematical functions: domain = input, range = output Variables are mathematical symbols: not associated with memory locations. Pure functional programming is state-free: no assignment Referential transparency: a function’s result depends only upon the values of its parameters. Functions and the Lambda Calculus The function Square has R (the reals) as domain and range. Square : R R Square(n) = n2 A function is total if it is defined for all values of its domain. Otherwise, it is partial. ., Square is total. A lambda expression is a particular way to define a function: LambdaExpression variable

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.