Functional Program Design in Scala

Start Date: 07/05/2020

Course Type: Common Course

Course Link:

Explore 1600+ online courses from top universities. Join Coursera today to learn data science, programming, business strategy, and more.

About Course

In this course you will learn how to apply the functional programming style in the design of larger applications. You'll get to know important new functional programming concepts, from lazy evaluation to structuring your libraries using monads. We'll work on larger and more involved examples, from state space exploration to random testing to discrete circuit simulators. You’ll also learn some best practices on how to write good Scala code in the real world. Several parts of this course deal with the question how functional programming interacts with mutable state. We will explore the consequences of combining functions and state. We will also look at purely functional alternatives to mutable state, using infinite data structures or functional reactive programming. Learning Outcomes. By the end of this course you will be able to: - recognize and apply design principles of functional programs, - design functional libraries and their APIs, - competently combine functions and state in one program, - understand reasoning techniques for programs that combine functions and state, - write simple functional reactive applications. Recommended background: You should have at least one year programming experience. Proficiency with Java or C# is ideal, but experience with other languages such as C/C++, Python, Javascript or Ruby is also sufficient. You should have some familiarity using the command line. This course is intended to be taken after Functional Programming Principles in Scala:

Course Syllabus

We'll start by revisiting some concepts that we have learned from Principles of Functional Programming in Scala; collections, pattern matching, and functions. We'll then touch on for-comprehensions, a powerful way in Scala to traverse a list, process it, and return a new list. We'll see how to do queries with for-comprehensions as well as how the for-comprehension is "desugared" into calls to higher-order functions by the Scala compiler. Finally, we'll discuss what monads are, and how to verify that the monad laws are satisfied for a number of examples.

Deep Learning Specialization on Coursera

Course Introduction

Functional Program Design in Scala This course teaches you how to use the functional programming model in Scala. You will learn how to use classes and inheritance to design functional programs. You will also learn about some of the key functional programming concepts that you need to know. This is the second course in the Functional Programming Specialization. The Specialization is the specialization on programming in Scala that focuses on design of functional programs. You should have equivalent experience to in the first course. Learning Outcomes 1) Describe how functional programming is implemented in Scala. 2) Explain how classes and inheritance work in Scala. 3) Design a program that uses functional programming. 4) Explain how functional programming uses design patterns. 5) Use design patterns to implement functional programs. 6) Use the provided functional programming tools to design a functional program. 7) Implement some of the design patterns. The course is designed to be complementary and stream-based; you should expect to learn a little from each course. You should also have fun while you learn! The course introduces the concept of functional programming and introduces the design patterns that implement it. These design patterns include: functional foldl, functional allocations, and functional collections. Throughout the course you will also learn about other Scala features, such as functional reactive programming, functional recursion, and functional testing. You should get to know most of the language features that are used in modern Scala programs.MODULE 1: FLEXIBLE

Course Tag

Streams Functional Design Reactive Programming Functional Programming

Related Wiki Topic

Article Example
Martin Odersky He teaches two courses on the massive open online course (MOOC) provider, Coursera, namely "Functional Programming Principles in Scala" and "Functional Program Design in Scala".
Functional design The standard way to assure functional design is to review the description of a module. If the description includes conjunctions such as "and" or "or", then the design has more than one responsibility, and is therefore likely to have side effects. The responsibilities need to be divided into several modules in order to achieve a functional design.
Functional design Functional Design is a paradigm used to simplify the design of hardware and software devices such as computer software and increasingly, 3D models. A functional design assures that each modular part of a device has only one responsibility and performs that responsibility with the minimum of side effects on other parts. Functionally designed modules tend to have low coupling.
Stanford Joint Program in Design The Joint Program in Design or "Stanford Design Program" is a graduate program jointly offered by the Mechanical Engineering Department and the Art Department at Stanford University, in Stanford, in the U.S. state of California. It is generally considered a leading design program in the United States. The program offers degrees in Mechanical Engineering and in Fine Arts/Design and is closely connected with the Stanford (The is not one of the seven schools at Stanford and does not grant degrees).
Functional verification In electronic design automation, functional verification is the task of verifying that the logic design conforms to specification. In everyday terms, functional verification attempts to answer the question "Does this proposed design do what is intended?" This is a complex task, and takes the majority of time and effort in most large electronic system design projects. Functional verification is a part of more encompassing "design verification", which, besides functional verification, considers non-functional aspects like timing, layout and power.
Functional testing Functional testing differs from system testing in that functional testing ""verifies" a program by checking it against ... design document(s) or specification(s)", while system testing ""validate[s]" a program by checking it against the published user or system requirements" (Kaner, Falk, Nguyen 1999, p. 52).
Functional programming Other functional programming languages that have seen use in industry include Scala, F#, (both being functional-OO hybrids with support for both purely functional and imperative programming) Wolfram Language, Lisp, Standard ML and Clojure.
Functional design Recently several software companies have introduced functional design as a concept to describe a Parametric feature based modeler for 3D modeling and simulation. In this context, they mean a parametric model of an object where the parameters are tied to real-world design criteria, such as an axle that will adjust its diameter based on the strength of the material and the amount of force being applied to it in the simulation. It is hoped that this will create efficiencies in the design process for mechanical and perhaps even architectural/structural assemblies by integrating the results of finite element analysis directly to the behavior of individual objects.
Scala (programming language) While supporting all of the object-oriented features available in Java (and in fact, augmenting them in various ways), Scala also provides a large number of capabilities that are normally found only in functional programming languages. Together, these features allow Scala programs to be written in an almost completely functional style, and also allow functional and object-oriented styles to be mixed.
Functional design Some functions inherently have mixed semantics. For example, a function "move the car from the garage" inherently has a side effect of changing the "car position". In some cases, the mixed semantics can extend over a large topological tree or graph of related concepts. In these unusual cases, functional design is not recommended by some authorities. Instead polymorphism, inheritance, or procedural methods may be preferred.
Community-based program design An emerging and growing practice of program design is program evaluation. Evaluation involves the ongoing systematic assessment of Community-based programs. Program designers often choose to incorporate evaluation into design in order to check program processes, determine impact, build a base of support, and/or justify replication/expansion.
Scala (programming language) Scala ( ) is a general-purpose programming language providing support for functional programming and a strong static type system. Designed to be concise, many of Scala's design decisions were designed to build from criticisms of Java.
Functional programming Programming in a functional style can also be accomplished in languages that are not specifically designed for functional programming. For example, the imperative Perl programming language has been the subject of a book describing how to apply functional programming concepts. This is also true of the PHP programming language. C++11, Java 8, and C# 3.0 all added constructs to facilitate the functional style. The Julia language also offers functional programming abilities. An interesting case is that of Scala – it is frequently written in a functional style, but the presence of side effects and mutable state place it in a grey area between imperative and functional languages.
Community-based program design Similar to traditional program design, community-based program design often utilizes a range of tools and models which are meant to enhance the efficacy and outcomes of the program’s design. The difference between traditional design and community-based design, when using these tools, is in the dynamics of the relationship between the designers, the participants, and the community as a whole. It evolved from the Charity Organization Society (COS) and the settlement house movements. Formally, community-based program development has been professionalized by such disciplines as urban studies and planning and social work.
Axiomatic design Axiomatic design is a systems design methodology using matrix methods to systematically analyze the transformation of customer needs into functional requirements, design parameters, and process variables. Specifically, functional requirements (FRs) are related to design parameters (DPs):
Community-based program design Community-based program design is a social program design method that enables social service providers, organizers, designers and evaluators to serve specific communities in their own environment. This program design approach depends on the participatory approach of community development often associated with community-based social work, and is often employed by community organizations. From this approach, program designers assess the needs and resources existing within a community, and, involving community stakeholders in the process, attempt to create a sustainable and equitable solution to address the community's needs.
Community-based program design Increased sustainability is an advantage of community-based program design. The program sustainability is ensured by the identification of solutions to problems based on existing resources accessible to all community members. Also, the involvement of local community leaders and local volunteers reinforce the sustainability of the impact of the program. Other advantages of community-based program design are collaborative participation, enriching diversity, serving clients in their community, and Addressing and meeting the needs of the community.
Scala (programming language) The Hello World program written in Scala has this form:
Functional design In a system of programs, a functional module will be easier to reuse because it is less likely to have side effects that appear in other parts of the system.
Functional specification When the team agrees that functional specification consensus is reached, the functional spec is typically declared "complete" or "signed off". After this, typically the software development and testing team write source code and test cases using the functional specification as the reference. While testing is performed, the behavior of the program is compared against the expected behavior as defined in the functional specification.