The purpose of this course is to introduce the theory and practice of functional programming (FP). The characteristic feature of FP is the emphasis on computation as evaluation. The traditional distinction between program and data characteristic of imperative programming (IP) is replaced by an emphasis on classifying expressions by types that specify their applicative behavior. Types include familiar (fixed and arbitrary precision) numeric types, tuples and records (structs), classified values (objects), inductive types such as trees, functions with specified inputs and outputs, and commands such as input and output. Well-typed expressions are evaluated to produce values, in a manner that is guaranteed to be type-safe. Because functional programs do not cause side-effects we can take advantage of simple mathematical principles in reasoning about applicative behavior and analyzing the runtime properties of programs.
The advantages of FP are significant:
Moreover, FP generalizes IP by treating commands as forms of data that may be executed for their effects.
Upon completion of this course, students will have acquired a mastery of basic functional programming techniques, including the design of programs using types, the development of programs using mathematical techniques for verification and analysis, the use of abstract types and modules to structure code, and the exploitation of parallelism in applications.
In particular, a student taking this course will learn to:
Students should also have some basic mathematical background, such as the ability to do a proof by mathematical induction, in order to reason about program correctness. In addition, it will be very useful for a student to have developed abstraction skills and to have familarity with the core mathematical structures of Computer Science, such as sets, relations, graphs, and trees.
Successful completion of this course is necessary and sufficient for entry into 15-210 Data Structures and Algorithms, which will build on the functional model of computation to develop a modern account of parallel algorithms for a wide variety of abstract types.
Take care of yourself. Do your best to maintain a healthy lifestyle this semester by eating well, exercising, avoiding drugs and alcohol, getting enough sleep and taking some time to relax. This will help you achieve your goals and cope with stress.
All of us benefit from support during times of struggle. You are not alone. There are many helpful resources available on campus and an important part of the college experience is learning how to ask for help. Asking for support sooner rather than later is often helpful.
If you or anyone you know experiences any academic stress, difficult life events, or feelings like anxiety or depression, we strongly encourage you to seek support. Counseling and Psychological Services (CaPS) is here to help: call 412-268-2922 and visit their website at http://www.cmu.edu/counseling/. Consider reaching out to a friend, faculty or family member you trust for help getting connected to the support that can help.
The university is technically required by federal law to not discriminate on the basis of race, color, national origin, sex, handicap or disability, age, sexual orientation, gender identity, religion, creed, ancestry, belief, veteran status, or genetic information. Therefore, the university is obligated to encourage anyone who experiences or observes unfair or hostile treatment on the basis of identity to speak out for justice and support, within the moment of the incident or after the incident has passed. Anyone can share these experiences using the following resources:
If you or someone you know is feeling suicidal or in danger of self-harm, call someone immediately, day or night:
Resolve Crisis Network: 888-796-8226
Suicide and Crisis Lifeline: 988
If the situation is life threatening, call the police:
On campus: CMU Police: 412-268-2323
Off campus: 911