全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 winbugs及其他软件专版
806 4
2016-04-09
CSci 555: Functional Programming
Spring Semester 2016
Lecture Notes

Sections



Schedule, Lecture Notes, and Examples

  • (26 Jan) Examine syllabus and discuss class organization.

  • Discuss programming paradigms

    • (26 Jan) A programming paradigm is "a way of conceptualizing what it means to perform computation, of structuring and organizing how tasks are to be carried out on a computer."
      -- from: Timothy A. Budd. Multiparadigm Programming in Leda, Addison-Wesley, 1995, page 3

    • (26 Jan) Programming Language Paradigms, section 1.3, pages 5-6, from the instructor's Notes on Functional Programming with Haskell

      Note: I use the phrase "programming language paradigms" in this document. More correctly, I should only say "programming paradigms" and differentiate among different styles of programming but not among languages. A language typically supports more than one style although some styles may be more directly supported than others.

      Concepts: programming language paradigm, imperative language, declarative language, functional language, relational or logic language; program state, implicit versus explicit state; sequencing versus recursion, execution of commands versus evaluation of expressions, "how" versus "what" to compute.

    • Peter Van Roy's Programming Paradigms Poster website


  • Motivate the study of functional programming

  • Introduce Scala to Java programmers

  • Explore recursion in Scala

    • (11 Feb) Recursion Concepts and Terminology: Scala Version [HTML] [PDF] [Elixir] [Lua]

      Concepts: recursion, linear and nonlinear recursion, tree recursion, backward and forward recursion, tail recursion, tail recursion optimization (also know as tail call elimination or proper tail calls), auxiliary functions, accumulating parameter (i.e. accumulator), nested functions, time and space complexity of recursive functions, termination arguments for recursive functions, preconditions and postconditions, Scala function definitions.

    • (for reference) Tail call (on Wikipedia)


  • Examine functions adapted from SICP

    • Background reading: Chapter 1 of the classic textbook SICP -- Harold Abelson and Gerald J. Sussman with Julie Sussman. Structure and Interpretation of Computer Programs, Second Edition, MIT Press, 1996:
      [book site at MIT Press] [HTML book] [SICP ebook site] [local copy of source code]

    • (9-11 Feb) First-order functions in Scala

      Concepts: Reinforces the concepts noted above for the "Notes on Scala for Java Programmers" and the notes on "Recursion Concepts and Terminology." Scala object as module, appropriate use of type inference and explicit typing of public features.
    • (11 Feb) Higher-order functions in Scala

      Definition: A higher-order function is a function that takes other functions as input and/or returns a function as its output value.

      Related definition: A first-class function is a function that is a first-class value in the language. It can be stored in a variable or some other data structure, passed to a function, or returned by a function.

      Concepts: Higher order functions allow us to capture the common aspects of a computational pattern in the fixed part of a function and pass in the variable aspects as functional arguments.

    • (for reference) Other versions

  • Study functional data structures


    • Background reading: "Functional Data Structures," Chapter 3, Paul Chiusano and Runar Bjarnason, Functional Programming in Scala

    • (16-18 Feb, 25 Feb, 1-3 Mar) Functional data structures lecture notes to accompany Chapter 3 (primarily on the List data type)
      [source]

      Concepts: referential transparency, side effect, immutable; algebraic data type, composite type, sum type (tagged, disjoint union, variant), product type (tuple, record), enumerated type, algebraic data type versus abstract data type, syntax, semantics; list, head, tail, constructor, sealed, case class, case object, distinction between case and regular objects, singleton object; polymorphism, ad hoc polymorphism, overloading, subtyping (subtype or inclusion polymorphism), parametric polymorphism (generics), type class, early versus late binding; variance, covariant, contravariant, invariant (nonvariant), variance annotation; companion object; form of the data guides the form of the algorithm, following types to implementations, pattern matching; associativity, identity element, monoid, zero element; variadic functions, apply method in companion object; data sharing, persistent data structure; when to throw exceptions, when not; backward recursion, tail recursion, accumulating parameter, auxiliary function; higher-order function, anonymous function (function literal), underscore notation in anonymous functions; fold functions, map function, filter function, flatMap function; local mutation; type inference, currying, partial application, upper and lower type bounds, view bounds; insertion sort, merge sort, total order pattern of computation, generalizing function definition; stack overflow error; method chaining, train wreck.

    • (23 Feb) No class because of instructor illness

本帖隐藏的内容

http://www.cs.olemiss.edu/~hcc/csci555/notes/555lectureNotes.html


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2016-4-9 09:51:54
复制代码
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2016-4-9 09:52:45
复制代码
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2016-4-9 12:51:16
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2016-4-9 12:51:17
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群