Functional Programming

 

Willamette Computer Science
ACM Student Chapter Lecture

Functional Programming
bullet Functional versus other programming paradigms
the functional programming approach differs from the traditional and current mainstream approaches to programming: it is more mathematical in flavor and amenable to logical proof
(look here for a comparison of paradigms)

Control bar


















































 

Willamette Computer Science
ACM Student Chapter Lecture

Functional Programming
bullet Functional versus other programming paradigms
bullet A high-level, abstract style of programming
functional programs are much more concise than their traditional counterparts: whether this makes them easier to understand is a matter of training and "mathematical sophistication"

Control bar


















































 

Willamette Computer Science
ACM Student Chapter Lecture

Functional Programming
bullet Functional versus other programming paradigms
bullet A high-level, abstract style of programming
bullet Functional purity = referential transparency
a crucial aspect of purely functional programming languages is that they admit substitution of equal values in any (syntactically valid) context: this facilitates proofs about programs

Control bar


















































 

Willamette Computer Science
ACM Student Chapter Lecture

Functional Programming
bullet Functional versus other programming paradigms
bullet A high-level, abstract style of programming
bullet Functional purity = referential transparency
bullet Algebraic data types
many functional languages support the definition of initial algebraic data types: these are a generalization of context-free term structures, but with overt tags on alternatives

Control bar


















































 

Willamette Computer Science
ACM Student Chapter Lecture

Functional Programming
bullet Functional versus other programming paradigms
bullet A high-level, abstract style of programming
bullet Functional purity = referential transparency
bullet Algebraic data types
bullet Higher-order functions
much of the power of functional languages comes from the use of higher-order functions, i.e., functions which take as arguments or return other functions

Control bar


















































 

Willamette Computer Science
ACM Student Chapter Lecture

Functional Programming
bullet Functional versus other programming paradigms
bullet A high-level, abstract style of programming
bullet Functional purity = referential transparency
bullet Algebraic data types
bullet Higher-order functions
bullet Polymorphism and other complex types
in order to make programming less tedious, type inference systems allow type to remain implicit when possible; programs are nevertheless guaranteed statically correct wrt types

(most typed languages use quantified types and other sophisticated features to make this possible)

Control bar


















































 

Willamette Computer Science
ACM Student Chapter Lecture

Functional Programming
bullet Functional versus other programming paradigms
bullet A high-level, abstract style of programming
bullet Functional purity = referential transparency
bullet Algebraic data types
bullet Higher-order functions
bullet Polymorphism and other complex types
bullet The Haskell class system
the Haskell programming language also features a class system which allows abstract specification of type signatures and instantiation of concrete types (NB: no axioms, though!)

Control bar