Zum Hauptinhalt springen
Nicht aus der Schweiz? Besuchen Sie lehmanns.de
Beginning F# - Robert Pickering

Beginning F# (eBook)

eBook Download: PDF
2011 | 1st ed.
448 Seiten
Apress (Verlag)
978-1-4302-2390-0 (ISBN)
Systemvoraussetzungen
46,99 inkl. MwSt
(CHF 45,90)
Der eBook-Verkauf erfolgt durch die Lehmanns Media GmbH (Berlin) zum Preis in Euro inkl. MwSt.
  • Download sofort lieferbar
  • Zahlungsarten anzeigen

Functional programming is perhaps the next big wave in application development. As experienced developers know, functional programming makes its mark by allowing application builders to develop solutions to complicated programming situations cleanly and efficiently. A rich history of functional languages, including Erlang and OCaml, leads the way to F#, Microsoft's effort to bring the elegance and focus of functional programming into the world of managed code and .NET.

With Beginning F#, you have a companion that that will help you explore F# and functional programming in a .NET environment. This book is both a comprehensive introduction to all aspects of the language and an incisive guide to using F# for real-world professional development.

Reviewed by Don Syme, the chief architect of F# at Microsoft Research, Beginning F# is a great foundation for exploring functional programming and its role in the future of application development.



Robert Pickering is an extraordinarily prolific writer on F#. The F# Wiki on his website, Strangelights.com, is among the most popular F# web sites in the world. He is a consultant for LexiFi, lives in France, and works on projects in England, Denmark, Holland, and Belgium. He received his bachelor of science degree in computer science from Manchester University in 1999.
Functional programming is perhaps the next big wave in application development. As experienced developers know, functional programming makes its mark by allowing application builders to develop solutions to complicated programming situations cleanly and efficiently. A rich history of functional languages, including Erlang and OCaml, leads the way to F#, Microsoft's effort to bring the elegance and focus of functional programming into the world of managed code and .NET.With Beginning F#, you have a companion that that will help you explore F# and functional programming in a .NET environment. This book is both a comprehensive introduction to all aspects of the language and an incisive guide to using F# for real-world professional development.Reviewed by Don Syme, the chief architect of F# at Microsoft Research, Beginning F# is a great foundation for exploring functional programming and its role in the future of application development.

Robert Pickering is an extraordinarily prolific writer on F#. The F# Wiki on his website, Strangelights.com, is among the most popular F# web sites in the world. He is a consultant for LexiFi, lives in France, and works on projects in England, Denmark, Holland, and Belgium. He received his bachelor of science degree in computer science from Manchester University in 1999.

Title Page 1
Copyright Page 2
Contents at a Glance 4
Table of Contents 5
Foreword 12
About the Author 14
About the Technical Reviewer 15
Acknowledgments 16
Preface 17
Chapter 1 Introduction 18
What Is Functional Programming? 18
Why Is Functional Programming Important? 19
What Is F#? 19
Who Is Using F#? 20
Who Is This Book For? 21
What’s Next? 21
Chapter 2 How to, Obtain, Install, and Use F# 23
Obtaining F# 23
Installing F# on Windows with Visual Studio 2008 24
Installing F# on Linux 24
Using F# in Different Ways 26
Visual Studio 26
SharpDevelop 27
F# Interactive Command-Line 28
The Examples in this Book 29
Summary 30
Chapter 3 Functional Programming 31
Literals 31
Functions 33
Identifiers and let Bindings 34
Identifier Names 35
Scope 36
Capturing Identifiers 40
The use Binding 41
Recursion 42
Operators 43
Function Application 44
Partial Application of Functions 46
Pattern Matching 47
Control Flow 51
Lists 52
Pattern Matching Against Lists 54
List Comprehensions 56
Types and Type Inference 59
Defining Types 61
Tuple and Record Types 61
Union or Sum Types 65
Type Definitions with Type Parameters 67
Recursive Type Definitions 69
Active Patterns 70
Complete Active Patterns 70
Incomplete Active Patterns 71
Units of Measure 73
Exceptions and Exception Handling 74
Lazy Evaluation 76
Summary 79
Chapter 4 Imperative Programming 80
The unit Type 80
The mutable Keyword 82
Defining Mutable Record Types 84
The ref Type 86
Arrays 88
Array Comprehensions 91
Control Flow 92
Calling Static Methods and Properties from .NET Libraries 95
Using Objects and Instance Members from .NET Libraries 97
Using Indexers from .NET Libraries 99
Working with Events from .NET Libraries 100
Pattern Matching over .NET Types 103
The |> Operator
Summary 107
Chapter 5 Object-Oriented Programming 108
Records As Objects 109
F# Types with Members 112
Object Expressions 115
Defining Classes 120
Optional Parameters 123
Defining Interfaces 124
Implementing Interfaces 125
Classes and Inheritance 127
Methods and Inheritance 128
Accessing the Base Class 129
Properties and Indexers 130
Overriding Methods from Non-F# Libraries 133
Abstract Classes 133
Classes and Static Methods 134
Classes with Explicit Fields and Constructors 135
Casting 136
Type Tests 138
Type Annotations for Subtyping 138
Defining Delegates 140
Structs 141
Enums 141
Summary 142
Chapter 6 Organizing, Annotating, and Quoting Code 143
Modules 143
Namespaces 145
Opening Namespaces and Modules 146
Giving Modules Aliases 149
Signature Files 149
Private and Internal let Bindings and Members 150
Module Scope 151
Module Execution 152
Optional Compilation 154
Comments 156
Doc Comments 156
Comments for Cross Compilation 158
Custom Attributes 159
Quoted Code 161
Summary 165
Chapter 7 The F# Libraries 166
The Native F# Library FSharp.Core.dll 166
The Microsoft.FSharp.Core.Operators Module 167
Arithmetic Operators 167
Floating-Point Arithmetic Functions 168
Tuple Functions 170
The Conversion Functions 170
The Logical Or and And Operators 171
The Microsoft.FSharp.Reflection Module 171
Reflection Over Types 171
Reflection Over Values 172
The Microsoft.FSharp.Collections.Seq Module 173
The map and iter Functions 174
The concat Function 175
The fold Function 175
The exists and forall Functions 176
The filter, find, and tryFind Functions 176
The choose Function 177
The init and initInfinite Functions 178
The unfold Function 179
The generate Function 180
The cast Function 181
The Microsoft.FSharp.Text.Printf Module 182
The Microsoft.FSharp.Control.Event Module 185
Creating and Handling Events 185
The filter Function 186
The partition Function 186
The map Function 187
The Power Pack Library FSharp.PowerPack.dll 187
The Microsoft.FSharp.Math Namespace 188
Summary 191
Chapter 8 User Interfaces 192
Introducing WinForms 192
Drawing WinForms 193
Working with Controls in WinForms 201
Using the Visual Studio Form Designer’s Forms in F# 206
Working with WinForms Events and the Event Module 209
Creating New Forms Classes 213
Introducing Windows Presentation Foundation 215
Introducing Windows Presentation Foundation 3D 217
Introducing GTK# 228
Introducing ASP.NET 230
Creating an IHttpHandler 231
Working with ASP.NET Web Forms 234
Summary 238
Chapter 9 Data Access 239
The System.Configuration Namespace 239
The System.IO Namespace 242
Using Sequences with System.IO 244
The System.Xml Namespace 246
ADO.NET 249
Data Binding 255
Data Binding and the DataGridView Control 257
ADO.NET Extensions 261
Introducing LINQ 266
Using LINQ to XML 267
Summary 270
Chapter 10 Parallel Programming 271
Threads, Memory, Locking and Blocking 272
Reactive Programming 275
Data Parallelism 281
Asynchronous Programming 288
Message Passing 292
Summary 301
Chapter 11 Distributed Applications 302
Networking Overview 302
Using TCP/IP Sockets 304
Using HTTP 314
Using HTTP with Google Spreadsheets 316
Using HTTP Posts 319
Using HTTP Asynchronously 320
Creating Web Services 323
Windows Communication Foundation 328
Hosting WCF Services 332
Summary 337
Chapter 12 Language-Oriented Programming 338
What Is Language-Oriented Programming? 338
Data Structures as Little Languages 338
A Data Structure–Based Language Implementation 340
Metaprogramming with Quotations 347
Implementing a Compiler and an Interpreter for an Arithmetic-Language 349
The Abstract Syntax Tree 350
Interpreting the AST 350
Compiling the AST 352
Compilation vs. Interpretation 356
Summary 360
Chapter 13 Parsing Text 361
Parsing CSV Format 361
Language Definition for the Other Examples 364
Using fslex.exe and fsyacc.exe 364
Tokenizing the Text: Fslex 365
Generating a Parser: Fsyacc 367
Using the Parser 369
FParsec Library 371
Summary 379
Chapter 14 Compatibility and Advanced Interoperation 380
Calling F# Libraries from C# 380
Returning Tuples 381
Exposing Functions That Take Functions As Parameters 383
Using Union Types 385
Using F# Lists 389
Defining Types in a Namespace 390
Defining Classes and Interfaces 392
Calling Using COM Objects 394
Using COM Style APIs 396
Using P/Invoke 397
Using Inline IL 400
Using F# from Native Code via COM 401
Hosting the CLR 404
Summary 406
Index 407

Erscheint lt. Verlag 27.1.2011
Zusatzinfo 448 p.
Verlagsort Berkeley
Sprache englisch
Themenwelt Mathematik / Informatik Informatik Programmiersprachen / -werkzeuge
Mathematik / Informatik Informatik Software Entwicklung
Mathematik / Informatik Informatik Theorie / Studium
Mathematik / Informatik Informatik Web / Internet
Schlagworte clean • Concurrent programming • Erlang • F# • Functional Programming • .NET • Objective CAML • Parallel Programming • programming
ISBN-10 1-4302-2390-1 / 1430223901
ISBN-13 978-1-4302-2390-0 / 9781430223900
Informationen gemäß Produktsicherheitsverordnung (GPSR)
Haben Sie eine Frage zum Produkt?
PDFPDF (Wasserzeichen)

DRM: Digitales Wasserzeichen
Dieses eBook enthält ein digitales Wasser­zeichen und ist damit für Sie persona­lisiert. Bei einer missbräuch­lichen Weiter­gabe des eBooks an Dritte ist eine Rück­ver­folgung an die Quelle möglich.

Dateiformat: PDF (Portable Document Format)
Mit einem festen Seiten­layout eignet sich die PDF besonders für Fach­bücher mit Spalten, Tabellen und Abbild­ungen. Eine PDF kann auf fast allen Geräten ange­zeigt werden, ist aber für kleine Displays (Smart­phone, eReader) nur einge­schränkt geeignet.

Systemvoraussetzungen:
PC/Mac: Mit einem PC oder Mac können Sie dieses eBook lesen. Sie benötigen dafür einen PDF-Viewer - z.B. den Adobe Reader oder Adobe Digital Editions.
eReader: Dieses eBook kann mit (fast) allen eBook-Readern gelesen werden. Mit dem amazon-Kindle ist es aber nicht kompatibel.
Smartphone/Tablet: Egal ob Apple oder Android, dieses eBook können Sie lesen. Sie benötigen dafür einen PDF-Viewer - z.B. die kostenlose Adobe Digital Editions-App.

Buying eBooks from abroad
For tax law reasons we can sell eBooks just within Germany and Switzerland. Regrettably we cannot fulfill eBook-orders from other countries.

Mehr entdecken
aus dem Bereich
Apps programmieren für macOS, iOS, watchOS und tvOS

von Thomas Sillmann

eBook Download (2025)
Carl Hanser Verlag GmbH & Co. KG
CHF 40,95
Apps programmieren für macOS, iOS, watchOS und tvOS

von Thomas Sillmann

eBook Download (2025)
Carl Hanser Verlag GmbH & Co. KG
CHF 40,95