This New Edition Contains New Chapters For Undergraduates, Where The Progression Is Purposefully Slow And Every Step Explained. The Chapter On Merge Sort Has Been Rewritten For Better Clarity And New Results Were Included. A Large Chapter On Xslt Has Been Added. This Book Addresses A Priori Different Audiences Whose Common Interest Is Functional Programming. For Undergraduate Students, We Offer A Very Progressive Introduction To Functional Programming, With Long Developments About Algorithms On Stacks And Some Kinds Of Binary Trees. We Also Study Memory Allocation Through Aliasing (Dynamic Data-Sharing), The Role Of The Control Stack And The Heap, Automatic Garbage Collection (Gc), The Optimisation Of Tail Calls And The Total Allocated Memory. Program Transformation Into Tail Form, Higher-Order Functions And Continuation-Passing Style Are Advanced Subjects Presented In The Context Of The Programming Language Erlang. We Give A Technique For Translating Short Functional Programs To Java. For Postgraduate Students, Each Functional Program Is Associated With The Mathematical Analysis Of Its Minimum And Maximum Cost (Efficiency), But Also Its Average And Amortised Cost. The Peculiarity Of Our Approach Is That We Use Elementary Concepts (Elementary Calculus, Induction, Discrete Mathematics) And We Systematically Seek Explicit Bounds In Order To Draw Asymptotic Equivalences. Furthermore, We Cover In Detail Proofs Of Properties Like Correctness, Termination And Equivalence. For The Professionals Who Do Not Know Functional Languages And Who Must Learn How To Program With The Language Xslt, We Propose An Introduction Which Dovetails The Part Dedicated To Undergraduate Students. The Reason Of This Unusual Didactic Choice Lies On The Observation That Xslt Is Rarely Taught In College, Therefore Programmers Who Have Not Been Exposed To Functional Programming Face The Two Challenges Of Learning A New Paradigm And Use Xml For Programming: Whereas The Former Puts Forth Recursion, The Latter Obscures It Because Of The Inherent Verbosity Of Xml. By Learning First An Abstract Functional Language, And Then Xml, We Hope For A Transfer Of Skills Towards The Design And Implementation In Xslt Without Mediation. This Book Differs From Traditional Textbooks In That It Does Not Cover Many Algorithms And Data Structures, Nor Many Programming Language Features, Nor Does It Present The Most Advanced Analytic Methods. Instead, Its Originality Lies In Constantly Tying Functional Programming, Cost Analysis, Proofs And Implementation. As Such, It Is An Eclectic Companion For Other Readings, Suitable For Different Courses, Like Functional Programming, Formal Logic And Analysis Of Algorithms.