ISBN-13: 9781119527503 / Angielski / Miękka / 2019 / 320 str.
ISBN-13: 9781119527503 / Angielski / Miękka / 2019 / 320 str.
Introduction 1About This Book 1Foolish Assumptions 3Icons Used in This Book 3Beyond the Book 4Where to Go from Here 5Part 1: Getting Started with Functional Programming 7Chapter 1: Introducing Functional Programming 9Defining Functional Programming 10Understanding its goals 11Using the pure approach 11Using the impure approach 12Considering Other Programming Paradigms 13Imperative 13Procedural 13Object-oriented 14Declarative 14Using Functional Programming to Perform Tasks 15Discovering Languages That Support Functional Programming 16Considering the pure languages 16Considering the impure languages 17Finding Functional Programming Online 17Chapter 2: Getting and Using Python 19Working with Python in This Book 20Creating better code 20Debugging functionality 20Defining why notebooks are useful 21Obtaining Your Copy of Anaconda 21Obtaining Analytics Anaconda 21Installing Anaconda on Linux 22Installing Anaconda on MacOS 23Installing Anaconda on Windows 24Understanding the Anaconda package 26Downloading the Datasets and Example Code 27Using Jupyter Notebook 28Defining the code repository 28Getting and using datasets 33Creating a Python Application 34Understanding cells 35Adding documentation cells 36Other cell content 38Running the Python Application 38Understanding the Use of Indentation 39Adding Comments 41Understanding comments 41Using comments to leave yourself reminders 43Using comments to keep code from executing 43Closing Jupyter Notebook 44Getting Help with the Python Language 45Chapter 3: Getting and Using Haskell 47Working with Haskell in This Book 48Obtaining and Installing Haskell 48Installing Haskell on a Linux system 50Installing Haskell on a Mac system 50Installing Haskell on a Windows system 52Testing the Haskell Installation 54Compiling a Haskell Application 56Using Haskell Libraries 59Getting Help with the Haskell Language 60Part 2: Starting Functional Programming Tasks 63Chapter 4: Defining the Functional Difference 65Comparing Declarations to Procedures 66Understanding How Data Works 67Working with immutable data 68Considering the role of state 68Eliminating side effects 69Seeing a Function in Haskell 69Using non-curried functions 69Using curried functions 70Seeing a Function in Python 73Creating and using a Python function 73Passing by reference versus by value 74Chapter 5: Understanding the Role of Lambda Calculus 77Considering the Origins of Lambda Calculus 78Understanding the Rules 80Working with variables 80Using application 81Using abstraction 82Performing Reduction Operations 85Considering alpha-conversion 85Considering ß-reduction 86Considering eta-conversion 88Creating Lambda Functions in Haskell 89Creating Lambda Functions in Python 89Chapter 6: Working with Lists and Strings 91Defining List Uses 92Creating Lists 93Using Haskell to create Lists 94Using Python to create lists 95Evaluating Lists 96Using Haskell to evaluate Lists 97Using Python to evaluate lists 99Performing Common List Manipulations 100Understanding the list manipulation functions 101Using Haskell to manipulate lists 101Using Python to manipulate lists 102Understanding the Dictionary and Set Alternatives 103Using dictionaries 103Using sets 104Considering the Use of Strings 105Understanding the uses for strings 105Performing string-related tasks in Haskell 106Performing string-related tasks in Python 106Part 3: Making Functional Programming Practical 109Chapter 7: Performing Pattern Matching 111Looking for Patterns in Data 112Understanding Regular Expressions 113Defining special characters using escapes 114Defining wildcard characters 115Working with anchors 115Delineating subexpressions using grouping constructs 116Using Pattern Matching in Analysis 117Working with Pattern Matching in Haskell 118Performing simple Posix matches 118Matching a telephone number with Haskell 120Working with Pattern Matching in Python 121Performing simple Python matches 121Doing more than matching 123Matching a telephone number with Python 124Chapter 8: Using Recursive Functions 125Performing Tasks More than Once 126Defining the need for repetition 126Using recursion instead of looping 127Understanding Recursion 128Considering basic recursion 129Performing tasks using lists 131Upgrading to set and dictionary 132Considering the use of collections 134Using Recursion on Lists 135Working with Haskell 135Working with Python 136Passing Functions Instead of Variables 137Understanding when you need a function 138Passing functions in Haskell 138Passing functions in Python 139Defining Common Recursion Errors 140Forgetting an ending 140Passing data incorrectly 141Defining a correct base instruction 141Chapter 9: Advancing with Higher-Order Functions 143Considering Types of Data Manipulation 144Performing Slicing and Dicing 146Keeping datasets controlled 146Focusing on specific data 147Slicing and dicing with Haskell 147Slicing and dicing with Python 150Mapping Your Data 151Understanding the purpose of mapping 151Performing mapping tasks with Haskell 152Performing mapping tasks with Python 153Filtering Data 154Understanding the purpose of filtering 154Using Haskell to filter data 155Using Python to filter data 156Organizing Data 157Considering the types of organization 157Sorting data with Haskell 158Sorting data with Python 159Chapter 10: Dealing with Types 161Developing Basic Types 162Understanding the functional perception of type 162Considering the type signature 162Creating types 164Composing Types 170Understanding monoids 170Considering the use of Nothing, Maybe, and Just 174Understanding semigroups 176Parameterizing Types 176Dealing with Missing Data 178Handling nulls 178Performing data replacement 180Considering statistical measures 180Creating and Using Type Classes 181Part 4: Interacting in Various Ways 183Chapter 11: Performing Basic I/O 185Understanding the Essentials of I/O 186Understanding I/O side effects 186Using monads for I/O 188Interacting with the user 188Working with devices 189Manipulating I/O Data 191Using the Jupyter Notebook Magic Functions 192Receiving and Sending I/O with Haskell 195Using monad sequencing 195Employing monad functions 195Chapter 12: Handling The Command Line 197Getting Input from the Command Line 198Automating the command line 198Considering the use of prompts 198Using the command line effectively 199Accessing the Command Line in Haskell 200Using the Haskell environment directly 200Making sense of the variety of packages 201Obtaining CmdArgs 202Getting a simple command line in Haskell 204Accessing the Command Line in Python 205Using the Python environment directly 205Interacting with Argparse 206Chapter 13: Dealing With Files 207Understanding How Local Files are Stored 208Ensuring Access to Files 209Interacting with Files 209Creating new files 210Opening existing files 211Manipulating File Content 212Considering CRUD 213Reading data 214Updating data 215Completing File-related Tasks 217Chapter 14: Working With Binary Data 219Comparing Binary to Textual Data 220Using Binary Data in Data Analysis 221Understanding the Binary Data Format 222Working with Binary Data 225Interacting with Binary Data in Haskell 225Writing binary data using Haskell 226Reading binary data using Haskell 227Interacting with Binary Data in Python 228Writing binary data using Python 228Reading binary data using Python 229Chapter 15: Dealing With Common Datasets 231Understanding the Need for Standard Datasets 232Finding the Right Dataset 233Locating general dataset information 233Using library-specific datasets 234Loading a Dataset 236Working with toy datasets 237Creating custom data 238Fetching common datasets 239Manipulating Dataset Entries 241Determining the dataset content 241Creating a DataFrame 243Accessing specific records 244Part 5: Performing Simple Error Trapping 247Chapter 16: Handling Errors in Haskell 249Defining a Bug in Haskell 250Considering recursion 250Understanding laziness 251Using unsafe functions 252Considering implementation-specific issues 253Understanding the Haskell-Related Errors 253Fixing Haskell Errors Quickly 256Relying on standard debugging 256Understanding errors versus exceptions 258Chapter 17: Handling Errors in Python 259Defining a Bug in Python 260Considering the sources of errors 260Considering version differences 262Understanding the Python-Related Errors 263Dealing with late binding closures 263Using a variable 264Working with third-party libraries 264Fixing Python Errors Quickly 265Understanding the built-in exceptions 265Obtaining a list of exception arguments 266Considering functional style exception handling 267Part 6: The Part of Tens 269Chapter 18: Ten Must-Have Haskell Libraries 271binary 271Hascore 273vect 273vector 274aeson 274attoparsec 275bytestring 275stringsearch 276text 276moo 277Chapter 19: Ten (Plus) Must-Have Python Packages 279Gensim 280PyAudio 281PyQtGraph 282TkInter 283PrettyTable 283SQLAlchemy 284Toolz 284Cloudera Oryx 285funcy 285SciPy 286XGBoost 287Chapter 20: Ten Occupation Areas that Use Functional Programming 289Starting with Traditional Development 289Going with New Development 290Creating Your Own Development 291Finding a Forward-Thinking Business 292Doing Something Really Interesting 292Developing Deep Learning Applications 293Writing Low-Level Code 293Helping Others in the Health Care Arena 294Working as a Data Scientist 294Researching the Next Big Thing 295Index 297
John Paul Mueller has written more than 100 books and 600+ articles on everything from networking and home security to database management and heads-down programming. His technical editing talents have helped more than 70 authors refine and polish their manuscripts. John's books address every level of skill from beginning to advanced.
1997-2024 DolnySlask.com Agencja Internetowa