Description : Learn functional programming concepts and techniques to build Python applications Key Features Study in detail all aspects of functional programming, including immutability, generators, and more Reinforce your learning through elaborate examples Learn how to implement advanced topics like closures, memoization, and monads in your applications Book Description Python supports four programming paradigms – imperative, procedural, object-oriented, and functional. Of these, functional programming is probably the least understood and the least used. This book covers several topics that are directly and indirectly related to functional programming. After a quick overview of functional programming and its characteristics, Functional Programming in Python explains the various concepts of Python, starting with functions. You'll learn how to change the value of an object by using mutability. You'll then look at recursion as a more functional alternative to looping for certain algorithms, and learn how memoization alleviates the limitations of recursion in certain situations. The book further explains how to use closures as function factories and how to handle errors and exceptions with functors and monads. By the end of this book, you'll have all the knowledge you need for developing your applications with functional programming in Python. What you will learn Understand the advantages and disadvantages of functional programming Use closures in your code to dynamically create functions Create your own iterators Use the general-purpose functools to create your own specialized reducing functions Study and implement list and generator comprehensions to create lists Create customized iterators with generators Who this book is for If you are a developer looking to create applications in Python using functional programming, this book is ideal for you. You will only need a basic knowledge of Python. Prior knowledge or experience of functional programming is not required.
Description : Bring the power of Swift functional programming to iOS, Web, macOS, watchOS and tvOS application development and build clean, smart, scalable and reliable applications About This Book Written for Swift 3 -Developers Preview version, this is a comprehensive guide that introduces iOS and OS X developers to the all-new world of functional programming that has so far been alien to them Learn about first-class functions and how imperative-style patterns can be converted into functional code using some simple techniques The book will get you familiar with using functional programming alongside existing OOP techniques so you can get the best of both worlds and develop clean, robust code Who This Book Is For The book is for developers with a basic knowledge of Swift programming aiming to incorporate functional programming paradigms in their day-to-day application development What You Will Learn First-class, higher-order, and pure functions Closures and capturing values Custom operators, recursion, and memoization Value and reference types in Swift Enumerations, algebraic data types, patterns, and pattern matching Generics and associated type protocols Higher-order functions such as map, flatMap filter, and reduce Dealing with optionals, fmap, and apply for multiple functional mapping Functional data structures such as Semigroup, Monoid, Binary Search Tree, Linked List, Stack, and Lazy List Immutability, copy constructors, and lenses Combining FP paradigms with OOP, FRP, and POP in your day-to-day development activities Developing a backend application with Swift Developing an iOS application with FP, OOP, FRP, and POP paradigms In Detail This book is based on Swift 3 Developer preview version and aims at simplifying the functional programming (FP) paradigms making it easily usable, by showing you how to solve many of your day-to-day development problems. Whether you are new to functional programming and Swift or experienced, this book will strengthen the skills you need to design and develop high-quality, scalable, and efficient applications. The book starts with functional programming concepts, the basics of Swift 3, and essential concepts such as functions, closures, optionals, enumerations, immutability, and generics in detail with coding examples. Furthermore, this book introduces more advanced topics such as function composition, monads, functors, applicative functors, memoization, lenses, algebraic data types, functional data structures, functional reactive programming (FRP), protocol-oriented programming (POP) and mixing object-oriented programming (OOP) with functional programming (FP) paradigms. Finally, this book provides a working code example of a front-end application developed with these techniques and its corresponding back-end application developed with Swift. Style and approach This is an easy-to-follow guide full of hands-on coding examples of real-world applications. Each topic is explained sequentially and placed in context, and for the more inquisitive, there are more details of the concepts used. It introduces the Swift language basics and functional programming techniques in simple, non-mathematical vocabulary with examples in Swift.
Description : The Glasgow Functional Programming Group is widely recognised for its research in lazy functional languages. Once again this year, for the fifth time, we retreated to a Scottish seaside town to discuss our latest work, this time spending three days in Ayr. We were joined by a number of colleagues from other universities and from industry, with whom we have been enjoying fruitful collaboration. The workshop serves the dual purpose of ensuring that the whole group remains informed of each other's work, and of providing workshop experience for research students. Most participants presented a short talk about their work, supplemented by papers which appeared in a draft proceedings distributed at the workshop. Since then the papers have been reviewed and the majority are now published here following revision. The workshop also contained a lively discussion session on functional language applications, to which the industrial participants made very helpful contributions. One interesting feature of this volume is the number of papers addressing practical issues of realistic use of functional languages, from benchmarking and profiling, to user interfaces and file handling. It is perhaps indicative that at last lazy functional languages are being used for significantly larger applications than has been typical in the past. This type of paper is likely to feature prominently in relevant conference proceedings for the next few years. Other papers here continue to address more theoretical topics, such as program logic, semantics of non determinism, program analysis, and loop detection.
Description : Apply Functional Programming techniques to C++ to build highly modular, testable, and reusable code About This Book Modularize your applications and make them highly reusable and testable Get familiar with complex concepts such as metaprogramming, concurrency, and immutability A highly practical guide to building functional code in C++ filled with lots of examples and real-world use cases Who This Book Is For This book is for C++ developers comfortable with OOP who are interested in learning how to apply the functional paradigm to create robust and testable apps. What You Will Learn Get to know the difference between imperative and functional approaches See the use of first-class functions and pure functions in a functional style Discover various techniques to apply immutable state to avoid side effects Design a recursive algorithm effectively Create faster programs using lazy evaluation Structure code using design patterns to make the design process easier Use concurrency techniques to develop responsive software Learn how to use the C++ Standard Template Library and metaprogramming in a functional way to improve code optimization In Detail Functional programming allows developers to divide programs into smaller, reusable components that ease the creation, testing, and maintenance of software as a whole. Combined with the power of C++, you can develop robust and scalable applications that fulfill modern day software requirements. This book will help you discover all the C++ 17 features that can be applied to build software in a functional way. The book is divided into three modules—the first introduces the fundamentals of functional programming and how it is supported by modern C++. The second module explains how to efficiently implement C++ features such as pure functions and immutable states to build robust applications. The last module describes how to achieve concurrency and apply design patterns to enhance your application's performance. Here, you will also learn to optimize code using metaprogramming in a functional way. By the end of the book, you will be familiar with the functional approach of programming and will be able to use these techniques on a daily basis. Style and approach This book uses a module-based approach, where each module will cover important aspects of functional programming in C++ and will help you develop efficient and robust applications through gaining a practical understanding.
Description : Learn how functional programming can help you in deploying web servers and working with databases in a declarative and pure way Key Features Learn functional programming from scratch Program applications with side effects in a pure way Gain expertise in working with array tools for functional programming Book Description In large projects, it can get difficult keeping track of all the interdependencies of the code base and how its state changes at runtime. Functional Programming helps us solve these problems. It is a paradigm specifically designed to deal with the complexity of software development. This book will show you how the right abstractions can reduce complexity and make your code easy to read and understand. Mastering Functional Programming begins by touching upon the basics such as what lambdas are and how to write declarative code with the help of functions. It then moves on to more advanced concepts such as pure functions and type classes, the problems they aim to solve, and how to use them in real-world scenarios. You will also explore some of the more advanced patterns in the world of functional programming, such as monad transformers and Tagless Final. In the concluding chapters, you will be introduced to the actor model, implement it in modern functional languages, and explore the subject of parallel programming. By the end of the book, you will have mastered the concepts entailing functional programming along with object-oriented programming (OOP) to build robust applications. What you will learn Write reliable and scalable software based on solid foundations Explore the cutting edge of computer science research Effectively solve complex architectural problems in a robust way Avoid unwanted outcomes such as errors or delays and focus on business logic Write parallel programs in a functional style using the actor model Use functional data structures and collections in your day-to-day work Who this book is for If you are from an imperative and OOP background, this book will guide you through the world of functional programming, irrespective of which programming language you use.
Description : This new edition of Mastering Mathematica focuses on using Mathematica as a programming language, because programming in Mathematica is the best way to use the software to its fullest capacity. The book covers functional programming, imperative programming, rewrite programming, and object-oriented programming. It also addresses the use of Mathematica as a symbolic manipulator and a general tool for knowledge representation. * Focus on four different types of programming styles with Mathematica: functional programming, rewrite (or rule-based) programmng, imperative (or procedural) programming, and object-oriented programming, with many examples of each style * Compatible with Mathematica 3.0 and its programming language * Chapters on graphics programming show how to make the most of the considerable graphics capabilities of Mathematica * Includes coverage of programming needed for creation of Mathematica packages that allow a user to extend the language as needed for particular uses * Applications include: * Polya pattern analysis * Critical points of functions * Object-oriented graph theory * Minimal surfaces * Mathematica-Enhanced CD-ROM Enclosed * Complete text in active Mathematica Notebook files, enhanced for v3.0; Allows you to evaluate complex examples without retyping; Extensive use of the v3.0 math typesetting system * Hyperlink index and table of contents * Instant access to any chapter or topic * Index is automatically merged with the main Mathematica help system forming a master index of all the user's Mathematica related information; Quickly see listings on a given topic from The Mathematica Book, Mastering Mathematica, the Guide to Standard Packages, or any other Help Browswer aware books you have installed
Description : Create robust and maintainable Java applications using the functional style of programming About This Book Explore how you can blend object-oriented and functional programming styles in Java Use lambda expressions to write flexible and succinct code A tutorial that strengthens your fundamentals in functional programming techniques to enhance your applications Who This Book Is For If you are a Java developer with object-oriented experience and want to use a functional programming approach in your applications, then this book is for you. All you need to get started is familiarity with basic Java object-oriented programming concepts. What You Will Learn Use lambda expressions to simplyfy code Use function composition to achieve code fluency Apply streams to simply implementations and achieve parallelism Incorporate recursion to support an application's functionality Provide more robust implementations using Optionals Implement design patterns with less code Refactor object-oriented code to create a functional solution Use debugging and testing techniques specific to functional programs In Detail Functional programming is an increasingly popular technology that allows you to simplify many tasks that are often cumbersome and awkward using an object-oriented approach. It is important to understand this approach and know how and when to apply it. Functional programming requires a different mindset, but once mastered it can be very rewarding. This book simplifies the learning process as a problem is described followed by its implementation using an object-oriented approach and then a solution is provided using appropriate functional programming techniques. Writing succinct and maintainable code is facilitated by many functional programming techniques including lambda expressions and streams. In this book, you will see numerous examples of how these techniques can be applied starting with an introduction to lambda expressions. Next, you will see how they can replace older approaches and be combined to achieve surprisingly elegant solutions to problems. This is followed by the investigation of related concepts such as the Optional class and monads, which offer an additional approach to handle problems. Design patterns have been instrumental in solving common problems. You will learn how these are enhanced with functional techniques. To transition from an object-oriented approach to a functional one, it is useful to have IDE support. IDE tools to refactor, debug, and test functional programs are demonstrated through the chapters. The end of the book brings together many of these functional programming techniques to create a more comprehensive application. You will find this book a very useful resource to learn and apply functional programming techniques in Java. Style and approach In this tutorial, each chapter starts with an introduction to the terms and concepts covered in that chapter. It quickly progresses to contrast an object-oriented approach with a functional approach using numerous code examples.