background preloader

F#

Facebook Twitter

F# Programming. Contents[edit] Preface - About this book and its authors.Introduction - Introducing the F# Programming Language. F# Basics[edit] This section is suitable for complete beginners to F# and Functional Programming in general. Getting Set Up - Installing F# on Windows, Linux and Mac.Basic Concepts - A lightweight crash course in functional programming concepts. Working With Functions[edit] F# is a functional programming language. Declaring Values and Functions - This article will show you how to declare simple functions, how to use type inference, and how to read F#'s 'arrow' notation.Pattern Matching Basics - Pattern matching is used for control flow. Immutable Data Structures[edit] "Data structure" is a fancy word which refers to anything that helps programmers group and represent related values in useful, logical units. Imperative Programming[edit] Mutable Data - By default, variables in F# are immutable.

Object Oriented Programming[edit] F# is a CLI/.NET programming language. F# Advanced[edit] Visual F# F# is a programming language that provides support for functional programming in addition to traditional object-oriented and imperative (procedural) programming. The Visual F# product provides support for developing F# applications and extending other .NET Framework applications by using F# code. F# is a first-class member of the .NET Framework languages and retains a strong resemblance to the ML family of functional languages. This version of Visual F# contains the F# 3.1 version of the language. F# supports functional programming constructs such as the following: Functions as values, which enables flexible manipulation of functions.

F# supports object-oriented programming and .NET Framework capabilities such as the following: The .NET Framework object model, including objects that have properties, methods, and events; polymorphism or virtual functions; inheritance; and interfaces. Visual F# supports information-rich programming. The main F# library is FSharp.Core.dll. Real World Functional Programming.

Real-World Functional Programming. Resources Functional programming languages are good at expressing complex ideas in a succinct, declarative way. Functional concepts such as "immutability" and "function values" make it easier to reason about code—as well as helping with concurrency. The new F# language, LINQ, certain new features of C#, and numerous .NET libraries now bring the power of functional programming to .NET coders. This book teaches the ideas and techniques of functional programming applied to real-world problems. You'll see how the functional way of thinking changes the game for .NET developers. Then, you'll tackle common issues using a functional approach. Thinking the functional way Blending OO and functional programming Effective F# code About the Authors Microsoft C# MVP Tomas Petricek is one of the leaders of the F# community. “I'd certainly recommend this to any .NET developer curious about learning how to apply ideas derived from functional programming to their C# code...”

Content/fsharp_leonb.pdf. Visual F# Samples and Walkthroughs. Walkthrough: Using Visual F# to Create, Debug, and Deploy an Application. This walkthrough introduces you to the experience of using F# in Visual Studio together with .NET Framework 4.5. In this walkthrough, you will learn how to get started with using Visual Studio to write F# applications through the example of a historical analysis of United States treasury interest-rate data. You will start with some quick analysis of the data by using the F# interactive window, then write and test some code to analyze the data, and then add a C# front end to explore integrating your F# code with other .NET languages.

You need the following components to complete this walkthrough: Visual Studio To create an F# script First, create an F# script. You will now write F# code to parse CSV (Comma-Separated Values) data. To develop a component by using F# Create a library project to expose the functionality that you have created. To Deploy the Application. F# tutorials & articles. Visual F# F# Language Reference. Try F# F# 3.0 Sample Pack - Home. The F# Software Foundation. An Introduction to Microsoft F# | pdc2008.

F# for Visualization. F# Charting: Library for Data Visualization. The F# Charting library implements charting suitable for use from F# scripting. Once you load the library as documented in referencing the library document, you can use the members of the Chart type to easily build charts. The following example creates a candlestick chart for a time series and sets the range of the Y axis: The library provides a composable API for creating charts. For example, you can use the Chart.Combine function to create a chart consisting of multiple line charts. The following example creates a single area showing sample income, expenses and profit in a single chart: How to get F# Charting The Windows version of the library is available as FSharp.Charting on NuGetThe Mac/Linux version of the library is available as FSharp.Charting.Gtk on NuGetAlternatively, you can download the source as a ZIP file or as a binary release as a ZIP file.

F# Charting features Approach, history and future This library is a successor to FSharpChart. Contributing Library license. Deedle: Exploratory data library for .NET. Deedle is an easy to use library for data and time series manipulation and for scientific programming. It supports working with structured data frames, ordered and unordered data, as well as time series. Deedle is designed to work well for exploratory programming using F# and C# interactive console, but can be also used in efficient compiled .NET code. The library implements a wide range of operations for data manipulation including advanced indexing and slicing, joining and aligning data, handling of missing values, grouping and aggregation, statistics and more. Titanic survivor analysis in 20 lines Assume we loaded Titanic data set into a data frame called titanic (the data frame has numerous columns including int Pclass and Boolean Survived).

Now we can calculate the survival rates for three different classes of tickets: We first group data by the Pclass and get the Survived column as a series of Boolean values. How to get Deedle The library is available as Deedle on NuGet. From Deedle. FsLab: F# for data science. Understanding the World with F# C9 Lectures: Dr. Don Syme - Introduction to F#, 1 of 3 | C9 Lectures: Dr. Don Syme - Introduction to F# FSharpChart - Wrapping System.Windows.​Forms.DataVisua​lization.Charti​ng sample in F# for Visual Studio 2010.

Overview: Charting Libraries for F# This topic contains the following sections. This article is associated with Real World Functional Programming: With Examples in F# and C# by Tomas Petricek with Jon Skeet from Manning Publications (ISBN 9781933988924, copyright Manning Publications 2009, all rights reserved). No part of these chapters may be reproduced, stored in a retrieval system, or transmitted in any form or by any means—electronic, electrostatic, mechanical, photocopying, recording, or otherwise—without the prior written permission of the publisher, except in the case of brief quotations embodied in critical articles or reviews. Creating plots and charts to visualize and understand data is an important aspect of working with data in F#.

The requirements for a charting technology depend on whether it is used in the F# Interactive environment or whether charts are created in a standalone application: This document introduces various options for creating charts in F#. Using Chart Controls Directly Figure 1. FSharpChart - Wrapping System.Windows.​Forms.DataVisua​lization.Charti​ng sample in F# for Visual Studio 2010.