Details

Functional Programming For Dummies


Functional Programming For Dummies


1. Aufl.

von: John Paul Mueller

20,99 €

Verlag: Wiley
Format: PDF
Veröffentl.: 28.12.2018
ISBN/EAN: 9781119527497
Sprache: englisch
Anzahl Seiten: 320

DRM-geschütztes eBook, Sie benötigen z.B. Adobe Digital Editions und eine Adobe ID zum Lesen.

Beschreibungen

<p><b>Your guide to the functional programming paradigm</b> </p> <p>Functional programming mainly sees use in math computations, including those used in Artificial Intelligence and gaming. This programming paradigm makes algorithms used for math calculations easier to understand and provides a concise method of coding algorithms by people who aren't developers. Current books on the market have a significant learning curve because they're written for developers, by developers—until now. </p> <p><i>Functional Programming for Dummies </i>explores the differences between the pure (as represented by the Haskell language) and impure (as represented by the Python language) approaches to functional programming for readers just like you. The pure approach is best suited to researchers who have no desire to create production code but do need to test algorithms fully and demonstrate their usefulness to peers. The impure approach is best suited to production environments because it's possible to mix coding paradigms in a single application to produce a result more quickly. <i>Functional Programming For Dummies</i> uses this two-pronged approach to give you an all-in-one approach to a coding methodology that can otherwise be hard to grasp.</p> <ul> <li>Learn pure and impure when it comes to coding</li> <li>Dive into the processes that most functional programmers use to derive, analyze and prove the worth of algorithms</li> <li>Benefit from examples that are provided in both Python and Haskell</li> <li>Glean the expertise of an expert author who has written some of the market-leading programming books to date</li> </ul> <p>If you’re ready to massage data to understand how things work in new ways, you’ve come to the right place!</p>
<p><b>Introduction</b><b> 1</b></p> <p>About This Book 1</p> <p>Foolish Assumptions 3</p> <p>Icons Used in This Book 3</p> <p>Beyond the Book 4</p> <p>Where to Go from Here 5</p> <p><b>Part 1: Getting Started with Functional Programming</b><b> 7</b></p> <p><b>Chapter 1: Introducing Functional Programming</b><b> 9</b></p> <p>Defining Functional Programming 10</p> <p>Understanding its goals 11</p> <p>Using the pure approach 11</p> <p>Using the impure approach 12</p> <p>Considering Other Programming Paradigms 13</p> <p>Imperative 13</p> <p>Procedural 13</p> <p>Object-oriented 14</p> <p>Declarative 14</p> <p>Using Functional Programming to Perform Tasks 15</p> <p>Discovering Languages That Support Functional Programming 16</p> <p>Considering the pure languages 16</p> <p>Considering the impure languages 17</p> <p>Finding Functional Programming Online 17</p> <p><b>Chapter 2: Getting and Using Python</b><b> 19</b></p> <p>Working with Python in This Book 20</p> <p>Creating better code 20</p> <p>Debugging functionality 20</p> <p>Defining why notebooks are useful 21</p> <p>Obtaining Your Copy of Anaconda 21</p> <p>Obtaining Analytics Anaconda 21</p> <p>Installing Anaconda on Linux 22</p> <p>Installing Anaconda on MacOS 23</p> <p>Installing Anaconda on Windows 24</p> <p>Understanding the Anaconda package 26</p> <p>Downloading the Datasets and Example Code 27</p> <p>Using Jupyter Notebook 28</p> <p>Defining the code repository 28</p> <p>Getting and using datasets 33</p> <p>Creating a Python Application 34</p> <p>Understanding cells 35</p> <p>Adding documentation cells 36</p> <p>Other cell content 38</p> <p>Running the Python Application 38</p> <p>Understanding the Use of Indentation 39</p> <p>Adding Comments 41</p> <p>Understanding comments 41</p> <p>Using comments to leave yourself reminders 43</p> <p>Using comments to keep code from executing 43</p> <p>Closing Jupyter Notebook 44</p> <p>Getting Help with the Python Language 45</p> <p><b>Chapter 3: Getting and Using Haskell </b><b>47</b></p> <p>Working with Haskell in This Book 48</p> <p>Obtaining and Installing Haskell 48</p> <p>Installing Haskell on a Linux system 50</p> <p>Installing Haskell on a Mac system 50</p> <p>Installing Haskell on a Windows system 52</p> <p>Testing the Haskell Installation 54</p> <p>Compiling a Haskell Application 56</p> <p>Using Haskell Libraries 59</p> <p>Getting Help with the Haskell Language 60</p> <p><b>Part 2: Starting Functional Programming Tasks</b><b> 63</b></p> <p><b>Chapter 4: Defining the Functional Difference </b><b>65</b></p> <p>Comparing Declarations to Procedures 66</p> <p>Understanding How Data Works 67</p> <p>Working with immutable data 68</p> <p>Considering the role of state 68</p> <p>Eliminating side effects 69</p> <p>Seeing a Function in Haskell 69</p> <p>Using non-curried functions 69</p> <p>Using curried functions 70</p> <p>Seeing a Function in Python 73</p> <p>Creating and using a Python function 73</p> <p>Passing by reference versus by value 74</p> <p><b>Chapter 5: Understanding the Role of Lambda Calculus</b><b> 77</b></p> <p>Considering the Origins of Lambda Calculus 78</p> <p>Understanding the Rules 80</p> <p>Working with variables 80</p> <p>Using application 81</p> <p>Using abstraction 82</p> <p>Performing Reduction Operations 85</p> <p>Considering <i>α</i>-conversion 85</p> <p>Considering <i>β</i>-reduction 86</p> <p>Considering <i>η</i>-conversion 88</p> <p>Creating Lambda Functions in Haskell 89</p> <p>Creating Lambda Functions in Python 89</p> <p><b>Chapter 6: Working with Lists and Strings</b><b> 91</b></p> <p>Defining List Uses 92</p> <p>Creating Lists 93</p> <p>Using Haskell to create Lists 94</p> <p>Using Python to create lists 95</p> <p>Evaluating Lists 96</p> <p>Using Haskell to evaluate Lists 97</p> <p>Using Python to evaluate lists 99</p> <p>Performing Common List Manipulations 100</p> <p>Understanding the list manipulation functions 101</p> <p>Using Haskell to manipulate lists 101</p> <p>Using Python to manipulate lists 102</p> <p>Understanding the Dictionary and Set Alternatives 103</p> <p>Using dictionaries 103</p> <p>Using sets 104</p> <p>Considering the Use of Strings 105</p> <p>Understanding the uses for strings 105</p> <p>Performing string-related tasks in Haskell 106</p> <p>Performing string-related tasks in Python 106</p> <p><b>Part 3: Making Functional Programming Practical</b><b> 109</b></p> <p><b>Chapter 7: Performing Pattern Matching</b><b> 111</b></p> <p>Looking for Patterns in Data 112</p> <p>Understanding Regular Expressions 113</p> <p>Defining special characters using escapes 114</p> <p>Defining wildcard characters 115</p> <p>Working with anchors 115</p> <p>Delineating subexpressions using grouping constructs 116</p> <p>Using Pattern Matching in Analysis 117</p> <p>Working with Pattern Matching in Haskell 118</p> <p>Performing simple Posix matches 118</p> <p>Matching a telephone number with Haskell 120</p> <p>Working with Pattern Matching in Python 121</p> <p>Performing simple Python matches 121</p> <p>Doing more than matching 123</p> <p>Matching a telephone number with Python 124</p> <p><b>Chapter 8: Using Recursive Functions</b><b> 125</b></p> <p>Performing Tasks More than Once 126</p> <p>Defining the need for repetition 126</p> <p>Using recursion instead of looping 127</p> <p>Understanding Recursion 128</p> <p>Considering basic recursion 129</p> <p>Performing tasks using lists 131</p> <p>Upgrading to set and dictionary 132</p> <p>Considering the use of collections 134</p> <p>Using Recursion on Lists 135</p> <p>Working with Haskell 135</p> <p>Working with Python 136</p> <p>Passing Functions Instead of Variables 137</p> <p>Understanding when you need a function 138</p> <p>Passing functions in Haskell 138</p> <p>Passing functions in Python 139</p> <p>Defining Common Recursion Errors 140</p> <p>Forgetting an ending 140</p> <p>Passing data incorrectly 141</p> <p>Defining a correct base instruction 141</p> <p><b>Chapter 9: Advancing with Higher-Order Functions</b><b> 143</b></p> <p>Considering Types of Data Manipulation 144</p> <p>Performing Slicing and Dicing 146</p> <p>Keeping datasets controlled 146</p> <p>Focusing on specific data 147</p> <p>Slicing and dicing with Haskell 147</p> <p>Slicing and dicing with Python 150</p> <p>Mapping Your Data 151</p> <p>Understanding the purpose of mapping 151</p> <p>Performing mapping tasks with Haskell 152</p> <p>Performing mapping tasks with Python 153</p> <p>Filtering Data 154</p> <p>Understanding the purpose of filtering 154</p> <p>Using Haskell to filter data 155</p> <p>Using Python to filter data 156</p> <p>Organizing Data 157</p> <p>Considering the types of organization 157</p> <p>Sorting data with Haskell 158</p> <p>Sorting data with Python 159</p> <p><b>Chapter 10: Dealing with Types</b><b> 161</b></p> <p>Developing Basic Types 162</p> <p>Understanding the functional perception of type 162</p> <p>Considering the type signature 162</p> <p>Creating types 164</p> <p>Composing Types 170</p> <p>Understanding monoids 170</p> <p>Considering the use of Nothing, Maybe, and Just 174</p> <p>Understanding semigroups 176</p> <p>Parameterizing Types 176</p> <p>Dealing with Missing Data 178</p> <p>Handling nulls 178</p> <p>Performing data replacement 180</p> <p>Considering statistical measures 180</p> <p>Creating and Using Type Classes 181</p> <p><b>Part 4: Interacting in Various Ways</b><b> 183</b></p> <p><b>Chapter 11: Performing Basic I/O</b><b> 185</b></p> <p>Understanding the Essentials of I/O 186</p> <p>Understanding I/O side effects 186</p> <p>Using monads for I/O 188</p> <p>Interacting with the user 188</p> <p>Working with devices 189</p> <p>Manipulating I/O Data 191</p> <p>Using the Jupyter Notebook Magic Functions 192</p> <p>Receiving and Sending I/O with Haskell 195</p> <p>Using monad sequencing 195</p> <p>Employing monad functions 195</p> <p><b>Chapter 12: Handling The Command Line</b><b> 197</b></p> <p>Getting Input from the Command Line 198</p> <p>Automating the command line 198</p> <p>Considering the use of prompts 198</p> <p>Using the command line effectively 199</p> <p>Accessing the Command Line in Haskell 200</p> <p>Using the Haskell environment directly 200</p> <p>Making sense of the variety of packages 201</p> <p>Obtaining CmdArgs 202</p> <p>Getting a simple command line in Haskell 204</p> <p>Accessing the Command Line in Python 205</p> <p>Using the Python environment directly 205</p> <p>Interacting with Argparse 206</p> <p><b>Chapter 13: Dealing With Files</b><b> 207</b></p> <p>Understanding How Local Files are Stored 208</p> <p>Ensuring Access to Files 209</p> <p>Interacting with Files 209</p> <p>Creating new files 210</p> <p>Opening existing files 211</p> <p>Manipulating File Content 212</p> <p>Considering CRUD 213</p> <p>Reading data 214</p> <p>Updating data 215</p> <p>Completing File-related Tasks 217</p> <p><b>Chapter 14: Working With Binary Data</b><b> 219</b></p> <p>Comparing Binary to Textual Data 220</p> <p>Using Binary Data in Data Analysis 221</p> <p>Understanding the Binary Data Format 222</p> <p>Working with Binary Data 225</p> <p>Interacting with Binary Data in Haskell 225</p> <p>Writing binary data using Haskell 226</p> <p>Reading binary data using Haskell 227</p> <p>Interacting with Binary Data in Python 228</p> <p>Writing binary data using Python 228</p> <p>Reading binary data using Python 229</p> <p><b>Chapter 15: Dealing With Common Datasets</b><b> 231</b></p> <p>Understanding the Need for Standard Datasets 232</p> <p>Finding the Right Dataset 233</p> <p>Locating general dataset information 233</p> <p>Using library-specific datasets 234</p> <p>Loading a Dataset 236</p> <p>Working with toy datasets 237</p> <p>Creating custom data 238</p> <p>Fetching common datasets 239</p> <p>Manipulating Dataset Entries 241</p> <p>Determining the dataset content 241</p> <p>Creating a DataFrame 243</p> <p>Accessing specific records 244</p> <p><b>Part 5: Performing Simple Error Trapping</b><b> 247</b></p> <p><b>Chapter 16: Handling Errors in Haskell</b><b> 249</b></p> <p>Defining a Bug in Haskell 250</p> <p>Considering recursion 250</p> <p>Understanding laziness 251</p> <p>Using unsafe functions 252</p> <p>Considering implementation-specific issues 253</p> <p>Understanding the Haskell-Related Errors 253</p> <p>Fixing Haskell Errors Quickly 256</p> <p>Relying on standard debugging 256</p> <p>Understanding errors versus exceptions 258</p> <p><b>Chapter 17: Handling Errors in Python</b><b> 259</b></p> <p>Defining a Bug in Python 260</p> <p>Considering the sources of errors 260</p> <p>Considering version differences 262</p> <p>Understanding the Python-Related Errors 263</p> <p>Dealing with late binding closures 263</p> <p>Using a variable 264</p> <p>Working with third-party libraries 264</p> <p>Fixing Python Errors Quickly 265</p> <p>Understanding the built-in exceptions 265</p> <p>Obtaining a list of exception arguments 266</p> <p>Considering functional style exception handling 267</p> <p><b>Part 6: The Part of Tens</b><b> 269</b></p> <p><b>Chapter 18: Ten Must-Have Haskell Libraries</b><b> 271</b></p> <p>binary 271</p> <p>Hascore 273</p> <p>vect 273</p> <p>vector 274</p> <p>aeson 274</p> <p>attoparsec 275</p> <p>bytestring 275</p> <p>stringsearch 276</p> <p>text 276</p> <p>moo 277</p> <p><b>Chapter 19: Ten (Plus) Must-Have Python Packages</b><b> 279</b></p> <p>Gensim 280</p> <p>PyAudio 281</p> <p>PyQtGraph 282</p> <p>TkInter 283</p> <p>PrettyTable 283</p> <p>SQLAlchemy 284</p> <p>Toolz 284</p> <p>Cloudera Oryx 285</p> <p>funcy 285</p> <p>SciPy 286</p> <p>XGBoost 287</p> <p><b>Chapter 20: Ten Occupation Areas that Use Functional Programming</b><b> 289</b></p> <p>Starting with Traditional Development 289</p> <p>Going with New Development 290</p> <p>Creating Your Own Development 291</p> <p>Finding a Forward-Thinking Business 292</p> <p>Doing Something Really Interesting 292</p> <p>Developing Deep Learning Applications 293</p> <p>Writing Low-Level Code 293</p> <p>Helping Others in the Health Care Arena 294</p> <p>Working as a Data Scientist 294</p> <p>Researching the Next Big Thing 295</p> <p>Index 297</p>
<p><b>John Paul Mueller</b> 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.
<ul> <li>Work faster with functional programming</li> <li>Understand the pure and impure approach</li> <li>Perform common tasks in both Python<sup>®</sup> and Haskell</li> </ul> <p><b>Master the fundamentals of functional programming</b> <p>Especially for nondevelopers, functional programming can be the perfect tool for coding an endless variety of problems. If you've been afraid that the paradigm was too complex, this book will quickly dispel those fears. You'll see how functional programming processes are used to derive, analyze, and prove the worth of algorithms; explore the differences in Haskell and Python and learn when to use pure and impure approaches; see why functional programming is vital for AI and gaming applications; and put your new skills to work. <b><p>Inside...</b> <ul> <li>Clarify functional programming goals</li> <li>Use Python<sup>®</sup> and Haskell</li> <li>Emphasis on the math connection in programming</li> <li>The role of lambda calculus</li> <li>Deal with types</li> <li>Handle binary data</li> <li>Simple error trapping</li> </ul>

Diese Produkte könnten Sie auch interessieren:

Domain Architectures
Domain Architectures
von: Daniel J. Duffy
PDF ebook
31,99 €