SlideShare a Scribd company logo
F# 3.0:
Strongly Typed Programming
in the Information Rich World
Proposition 1
The world is incredibly
information-rich
Christoph Santschi – dipl. Natw. ETHZ
Proposition 2
Modern financial enterprises are
incredibly information-rich
Proposition 3
Our languages are information-
sparse
Proposition 4
This is a Problem
(especially for strongly typed Programming)
With F# we want to help fix this...
The mechanism we're adding
to F# is called Type Providers
LINQ + Type Providers
=
Language Integrated Data and
Services
F#is...
...a practical, supported, interoperable,
functional language that allows you to write
simple code to solve complex problems.
Crossing boundaries
“Fresh Code” Performance
Professional Development
Expressivity for Programming
Mathematical tasks
C++
C#
Java
Programming
F#
Python
...
Financial engineering
Algorithmic Trading
DSL programming
Math‐
...
ematica
QF modelling
Why is F# appealing in finance?
 Functional programming fits with financial work
– Programmatic modelling
– Compositional parallel & GPU programming
– Domain specific languages – internal and external
– Efficient execution
 Plays differently for different roles:
– Quants contribute to component development
– Architects explore hard problems fluently
– Developers tackle parallel and async programming
Simplicity: Functions as Values
abstract class
Command {
public virtual void Execute();
}
abstract class RoverCommand :
Command {
protected Rover Rover { get; private set;
public RoverCommand(MarsRover
rover) {
this.Rover = rover;
}
}
class BreakCommand :
RoverCommand {
public BreakCommand(Rover rover) : base(rover
{
}
public override void Execute()
{
Rover.Rotate(-5.ø);
}
}
class TurnLeftCommand :
RoverCommand {
}
type Command = Command of (Rover -> unit)
let BreakCommand =
Command(fun rover -> rover.Accelerate(-1.ø))
let TurnLeftCommand =
Command(fun rover -> rover.Rotate(-5.ø<degs>))
public TurnLeftCommand(Rover rover) : base(ro
{
}
public override void Execute()
{
Rover.Rotate(-5.ø);
}
Simplicity: Functional Data
Tuple<U,T> Swap<T,U>(Tuple<T,U>
t) {
return new Tuple<U,T>(t.Item2, t.Item1)
}
}
let reduce f (x, y, z)
= f x + f y + f z
return f(t.Item1) + f(t.Item2) + f (t.Item3);
C#
ReadOnlyCollection<Tuple<T,T,T>> Rotations<T>(Tuple<T,T,T> t)
{
new ReadOnlyCollection<int>
(new Tuple<T,T,T>[]
{ new Tuple<T,T,T>(t.Item1,t.Item2,t.Item3);
new Tuple<T,T,T>(t.Item3,t.Item1,t.Item2);
new Tuple<T,T,T>(t.Item2,t.Item3,t.Item1); });
let rotations (x, y,
z) = [ (x, y,
z); (z, x, y);
(y, z, x) ]
}
int Reduce<T>(Func<T,int> f,Tuple<T,T,T>
t) {
let swap (x, y) = (y, x)
Examples #2/#3: Finance
companies
Insurance Company Improves Time-to-
Market with Enhanced Rating Engine
Grange
OV er ;eW
Country or Region: UnitedStates
Industry: Financial services—Insurance
Customer Profile
Headquartered in Co I umb us, Ohio,
GrargeInsurance offers automobile,
home,and business insurance protection
to po I icyho Iders in 13 US. states.It em
ploys 1,500 people.
Business Situation
To maintain its compefitivestancling
and ifsreputationarnorg agents for
beim] easyto do business with, Orange
Insurance needed to keep its rating
erkgineworking attop performarKe.
Solulieff
Llsi ng M icrosoftle Visua I Stud 'Off Tea m
SystemandVisualF:rf,thecompany
Insurance
"With this streamlined development cycl
rapidly deliver more powerful solutionsl
they can deliver more choices and bette
policyholdersthat much faster."
GlennWaton, Associate Vice President, Personal Li nes, IT, Orange
For nearly 75 years, Grange Insurance has offer
products and services to policyholders in more
states. To maintain its well-earned reputation
company decided to enhance its rating engine-
for rating policies and performing what-if modi
analyses, and other vital activities. Working wit
Group and using the Microsoft! Visual Studio!
development environment and Microsoft ViSLIE
ming language, Grange Insurance parallelized i
husto men. Financial services firm
Country or Region: Europe Industry:
Financial services—Banking
Customer Profile
A la rge Europeanfinancial services firm
offers banking and asset-management
services to clients in 50 countries. In
2004, the bank earned morethan 11.5.$6
billion in income.
SoftwareandServices
 MicrosoftVisual Studio
 MicrosoftVisual
 MicrosoftVisualStudio2010
 Technologies
 Microsoft .NET Framework
 WindowsPresentationFoundation
Banking Firm Uses Functional Language to
Speed Development by 50 Percent
"VVe could not have developed 200 models in two
yearswithout F# and Visual Studio. lt would have
taken us at least twice as lang with our previaustools."
Directerata la rge Europeant na ncia I servicefirm
A large financial services firm in Europe sought new
development tools that could cut costs, boost productivity, and
improvethe quality of its mathematical models. To address its
needs, the bank deployed Microsoft F#, the Microsoft .NET
Framework, and Microsoft Visual Studio. It will sonn upgrade to
Visual Studio 2010 and the integrated Microsoft Visual F#. With
its new tools, the bank can speed development by 50 percent
or more, improve quality, and reduce costs.
Business Needs desktop and ona remotecluster of senyers
A Typeprovide is:
“A compile-time component
that provides a computed
space of types and methods
on-demand ...”
“A compiler plug-in...”
“An adaptor between
data/services and the .NET
type
system...”
// Freebase.fsx
// Example of reading from freebase.com in F#
// by Jomo Fisher
#r "System.Runtime.Serial
#r "System.ServiceModel.Wbl
#r "System.Web"
#r "System.Xml"
" et Query<'T>(query:string) : 'T =
let query = query.Replace("'",""")
let queryUrl = sprintf "http://api.freebase.com/api/service/mqlread?query=%s"
"{"query":"+query+"}"
open System open
System.IO open
System.Netopen
System.Text open
System.Web
open System.Security.Authation let response =
request.GetResponse() open System.Runtime.Seria
let request : HttpWebRequest = downcast WebRequest.Create(queryUrl)
request.Method <- "GET"request.ContentType <- "application/x-www-form-urncoded"
How would we do
this previously?
[<DataContract>]
type Result<'TResult> = {
[<field: DataMember(N
Code:string
[<field: DataMember(N re>
Result:'TResult
[<field: DataMember(Nmessage"let data =
Message:string
}
let result
= try
use reader = new StreamReader(response.GetResponseStream()) ]
reader.ReadToEnd();
finally
] sponse.Close()
] Encoding.Unicode.GetBytes(result);
let stream = new MemoryStream()
stream.Write(data, 0, data.Length);
stream.Position <- 0L
[<DataContract>]
type ChemicalElement = {
[<field: DataMember(Nname")let resu>
Name:string
[<field: DataMember(Ningpoint")raise (Invali >
let ser = Json.DataContractJsonSerializer(typeof<Result<'T>>)
] lt = ser.ReadObject(stream) :?> Result<'T>
if result.Code<>"/api/status/ok" then
] dOperationException(result.Message))
BoilingPoint:string else
[<field: DataMember(Nicmass")result.Result>]
AtomicMass:string
} let elements = Query<ChemicalElement
array>("[{'type':'/chemistry/chemical_element','name':null,'boiling_point':null,'atomic_mass
':null}]")
elements |> Array.iter(fun element->printfn "%A" element)
Note: F# itself still contains
no data
Open architecture
You can write your
own type
provider
Language Integrated
Data Market Directory
SQL
Web Services
type Data = WsdlService<uhttp://teny. xignite • c ornixF ut ures .asmx?WSDL"
let financials = DataiGetServiceContext()
financials.GetQuotes "IBM"
Fluent Typed
Access To
WSDL
F# 3.0: Queries
let avatarTitles =
query { for t in netflix.Titles do
where (t.Name.Contains "Avatar")
select t }
let avatarTitles =
query { for t in netflix.Titles do
where (t.Name.Contains "Avatar")
sortBy t.Name
select t }
let avatarTitles =
query { for t in netflix.Titles do
where (t.Name.Contains "Avatar")
sortBy t.Name
select t
take 100 }
Conclusion 1
Huge Information Spaces can be
Software Components
Conclusion 2
Multiple data standards with one
simple mechanism
Conclusion 3
Integrated Data Access Empowers
Both Programmers and Analysts
Summary
The financial world is massively
information rich
Our enterprise financial programming needs
to be information‐rich too
Information‐richness changes how we think
about programming and analysis

More Related Content

What's hot

DITEC - Programming with Java
DITEC - Programming with JavaDITEC - Programming with Java
DITEC - Programming with Java
Rasan Samarasinghe
 
DISE - Windows Based Application Development in Java
DISE - Windows Based Application Development in JavaDISE - Windows Based Application Development in Java
DISE - Windows Based Application Development in Java
Rasan Samarasinghe
 
Esoft Metro Campus - Programming with C++
Esoft Metro Campus - Programming with C++Esoft Metro Campus - Programming with C++
Esoft Metro Campus - Programming with C++
Rasan Samarasinghe
 
Python Unit 3 - Control Flow and Functions
Python Unit 3 - Control Flow and FunctionsPython Unit 3 - Control Flow and Functions
Python Unit 3 - Control Flow and Functions
DhivyaSubramaniyam
 
Interpreter Design Pattern in Javascript
Interpreter Design Pattern in JavascriptInterpreter Design Pattern in Javascript
Interpreter Design Pattern in Javascript
Dmytro Verbovyi
 
DISE - Windows Based Application Development in C#
DISE - Windows Based Application Development in C#DISE - Windows Based Application Development in C#
DISE - Windows Based Application Development in C#
Rasan Samarasinghe
 
Python unit 3 and Unit 4
Python unit 3 and Unit 4Python unit 3 and Unit 4
Python unit 3 and Unit 4
Anandh Arumugakan
 
DITEC - Programming with C#.NET
DITEC - Programming with C#.NETDITEC - Programming with C#.NET
DITEC - Programming with C#.NET
Rasan Samarasinghe
 
Domain Driven Design with the F# type System -- F#unctional Londoners 2014
Domain Driven Design with the F# type System -- F#unctional Londoners 2014Domain Driven Design with the F# type System -- F#unctional Londoners 2014
Domain Driven Design with the F# type System -- F#unctional Londoners 2014
Scott Wlaschin
 
Esoft Metro Campus - Certificate in java basics
Esoft Metro Campus - Certificate in java basicsEsoft Metro Campus - Certificate in java basics
Esoft Metro Campus - Certificate in java basics
Rasan Samarasinghe
 
DIWE - Fundamentals of PHP
DIWE - Fundamentals of PHPDIWE - Fundamentals of PHP
DIWE - Fundamentals of PHP
Rasan Samarasinghe
 
C++ questions And Answer
C++ questions And AnswerC++ questions And Answer
C++ questions And Answer
lavparmar007
 
Python Control structures
Python Control structuresPython Control structures
Python Control structures
Siddique Ibrahim
 
While loop
While loopWhile loop
While loop
RabiyaZhexembayeva
 
Seven Ineffective Coding Habits of Many Programmers
Seven Ineffective Coding Habits of Many ProgrammersSeven Ineffective Coding Habits of Many Programmers
Seven Ineffective Coding Habits of Many Programmers
Kevlin Henney
 
Control Structures in Python
Control Structures in PythonControl Structures in Python
Control Structures in Python
Sumit Satam
 
Clean code _v2003
 Clean code _v2003 Clean code _v2003
Clean code _v2003
R696
 
C++ Programming Language
C++ Programming Language C++ Programming Language
C++ Programming Language
Mohamed Loey
 

What's hot (19)

1
11
1
 
DITEC - Programming with Java
DITEC - Programming with JavaDITEC - Programming with Java
DITEC - Programming with Java
 
DISE - Windows Based Application Development in Java
DISE - Windows Based Application Development in JavaDISE - Windows Based Application Development in Java
DISE - Windows Based Application Development in Java
 
Esoft Metro Campus - Programming with C++
Esoft Metro Campus - Programming with C++Esoft Metro Campus - Programming with C++
Esoft Metro Campus - Programming with C++
 
Python Unit 3 - Control Flow and Functions
Python Unit 3 - Control Flow and FunctionsPython Unit 3 - Control Flow and Functions
Python Unit 3 - Control Flow and Functions
 
Interpreter Design Pattern in Javascript
Interpreter Design Pattern in JavascriptInterpreter Design Pattern in Javascript
Interpreter Design Pattern in Javascript
 
DISE - Windows Based Application Development in C#
DISE - Windows Based Application Development in C#DISE - Windows Based Application Development in C#
DISE - Windows Based Application Development in C#
 
Python unit 3 and Unit 4
Python unit 3 and Unit 4Python unit 3 and Unit 4
Python unit 3 and Unit 4
 
DITEC - Programming with C#.NET
DITEC - Programming with C#.NETDITEC - Programming with C#.NET
DITEC - Programming with C#.NET
 
Domain Driven Design with the F# type System -- F#unctional Londoners 2014
Domain Driven Design with the F# type System -- F#unctional Londoners 2014Domain Driven Design with the F# type System -- F#unctional Londoners 2014
Domain Driven Design with the F# type System -- F#unctional Londoners 2014
 
Esoft Metro Campus - Certificate in java basics
Esoft Metro Campus - Certificate in java basicsEsoft Metro Campus - Certificate in java basics
Esoft Metro Campus - Certificate in java basics
 
DIWE - Fundamentals of PHP
DIWE - Fundamentals of PHPDIWE - Fundamentals of PHP
DIWE - Fundamentals of PHP
 
C++ questions And Answer
C++ questions And AnswerC++ questions And Answer
C++ questions And Answer
 
Python Control structures
Python Control structuresPython Control structures
Python Control structures
 
While loop
While loopWhile loop
While loop
 
Seven Ineffective Coding Habits of Many Programmers
Seven Ineffective Coding Habits of Many ProgrammersSeven Ineffective Coding Habits of Many Programmers
Seven Ineffective Coding Habits of Many Programmers
 
Control Structures in Python
Control Structures in PythonControl Structures in Python
Control Structures in Python
 
Clean code _v2003
 Clean code _v2003 Clean code _v2003
Clean code _v2003
 
C++ Programming Language
C++ Programming Language C++ Programming Language
C++ Programming Language
 

Viewers also liked

iOS App Development with F# and Xamarin
iOS App Development with F# and XamariniOS App Development with F# and Xamarin
iOS App Development with F# and Xamarin
Rachel Reese
 
F# Server-side programming
F# Server-side programmingF# Server-side programming
F# Server-side programming
7sharp9
 
Introduction to F# for the C# developer
Introduction to F# for the C# developerIntroduction to F# for the C# developer
Introduction to F# for the C# developer
njpst8
 
Hadoop World 2011: Apache HBase Road Map - Jonathan Gray - Facebook
Hadoop World 2011: Apache HBase Road Map - Jonathan Gray - FacebookHadoop World 2011: Apache HBase Road Map - Jonathan Gray - Facebook
Hadoop World 2011: Apache HBase Road Map - Jonathan Gray - Facebook
Cloudera, Inc.
 
Getting Started with F#
Getting Started with F#Getting Started with F#
Getting Started with F#Rachel Reese
 
Get Functional on the CLR: Intro to Functional Programming with F#
Get Functional on the CLR: Intro to Functional Programming with F# Get Functional on the CLR: Intro to Functional Programming with F#
Get Functional on the CLR: Intro to Functional Programming with F#
David Alpert
 

Viewers also liked (6)

iOS App Development with F# and Xamarin
iOS App Development with F# and XamariniOS App Development with F# and Xamarin
iOS App Development with F# and Xamarin
 
F# Server-side programming
F# Server-side programmingF# Server-side programming
F# Server-side programming
 
Introduction to F# for the C# developer
Introduction to F# for the C# developerIntroduction to F# for the C# developer
Introduction to F# for the C# developer
 
Hadoop World 2011: Apache HBase Road Map - Jonathan Gray - Facebook
Hadoop World 2011: Apache HBase Road Map - Jonathan Gray - FacebookHadoop World 2011: Apache HBase Road Map - Jonathan Gray - Facebook
Hadoop World 2011: Apache HBase Road Map - Jonathan Gray - Facebook
 
Getting Started with F#
Getting Started with F#Getting Started with F#
Getting Started with F#
 
Get Functional on the CLR: Intro to Functional Programming with F#
Get Functional on the CLR: Intro to Functional Programming with F# Get Functional on the CLR: Intro to Functional Programming with F#
Get Functional on the CLR: Intro to Functional Programming with F#
 

Similar to F sharp - an overview

London F-Sharp User Group : Don Syme on F# - 09/09/2010
London F-Sharp User Group : Don Syme on F# - 09/09/2010London F-Sharp User Group : Don Syme on F# - 09/09/2010
London F-Sharp User Group : Don Syme on F# - 09/09/2010Skills Matter
 
Combinators, DSLs, HTML and F#
Combinators, DSLs, HTML and F#Combinators, DSLs, HTML and F#
Combinators, DSLs, HTML and F#Robert Pickering
 
Core .NET Framework 4.0 Enhancements
Core .NET Framework 4.0 EnhancementsCore .NET Framework 4.0 Enhancements
Core .NET Framework 4.0 EnhancementsRobert MacLean
 
Flyte kubecon 2019 SanDiego
Flyte kubecon 2019 SanDiegoFlyte kubecon 2019 SanDiego
Flyte kubecon 2019 SanDiego
KetanUmare
 
Types Working for You, Not Against You
Types Working for You, Not Against YouTypes Working for You, Not Against You
Types Working for You, Not Against You
C4Media
 
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docxJLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
vrickens
 
Pres_python_talakhoury_26_09_2023.pdf
Pres_python_talakhoury_26_09_2023.pdfPres_python_talakhoury_26_09_2023.pdf
Pres_python_talakhoury_26_09_2023.pdf
RamziFeghali
 
Chapter 1 Class 12 Computer Science Unit 1
Chapter 1 Class 12 Computer Science Unit 1Chapter 1 Class 12 Computer Science Unit 1
Chapter 1 Class 12 Computer Science Unit 1
ssusera7a08a
 
Revision of the basics of python1 (1).pdf
Revision of the basics of python1 (1).pdfRevision of the basics of python1 (1).pdf
Revision of the basics of python1 (1).pdf
optimusnotch44
 
OneTeam Media Server
OneTeam Media ServerOneTeam Media Server
OneTeam Media Server
Mickaël Rémond
 
INTRODUCTION TO FUNCTIONS IN PYTHON
INTRODUCTION TO FUNCTIONS IN PYTHONINTRODUCTION TO FUNCTIONS IN PYTHON
INTRODUCTION TO FUNCTIONS IN PYTHON
vikram mahendra
 
Adopting F# at SBTech
Adopting F# at SBTechAdopting F# at SBTech
Adopting F# at SBTech
Antya Dev
 
Deep Anomaly Detection from Research to Production Leveraging Spark and Tens...
 Deep Anomaly Detection from Research to Production Leveraging Spark and Tens... Deep Anomaly Detection from Research to Production Leveraging Spark and Tens...
Deep Anomaly Detection from Research to Production Leveraging Spark and Tens...
Databricks
 
Standard Libraries in Python Programming
Standard Libraries in Python ProgrammingStandard Libraries in Python Programming
Standard Libraries in Python Programming
Rohan Chougule
 
Going open source with small teams
Going open source with small teamsGoing open source with small teams
Going open source with small teams
Jamie Thomas
 
PPt Revision of the basics of python1.pptx
PPt Revision of the basics of python1.pptxPPt Revision of the basics of python1.pptx
PPt Revision of the basics of python1.pptx
tcsonline1222
 
OneTeam Media Server
OneTeam Media ServerOneTeam Media Server
OneTeam Media Server
Mickaël Rémond
 
Patterns & Practices for Cloud-based Microservices
Patterns & Practices for Cloud-based MicroservicesPatterns & Practices for Cloud-based Microservices
Patterns & Practices for Cloud-based Microservices
C4Media
 
C++ functions
C++ functionsC++ functions
C++ functions
Dawood Jutt
 

Similar to F sharp - an overview (20)

London F-Sharp User Group : Don Syme on F# - 09/09/2010
London F-Sharp User Group : Don Syme on F# - 09/09/2010London F-Sharp User Group : Don Syme on F# - 09/09/2010
London F-Sharp User Group : Don Syme on F# - 09/09/2010
 
Combinators, DSLs, HTML and F#
Combinators, DSLs, HTML and F#Combinators, DSLs, HTML and F#
Combinators, DSLs, HTML and F#
 
Core .NET Framework 4.0 Enhancements
Core .NET Framework 4.0 EnhancementsCore .NET Framework 4.0 Enhancements
Core .NET Framework 4.0 Enhancements
 
Flyte kubecon 2019 SanDiego
Flyte kubecon 2019 SanDiegoFlyte kubecon 2019 SanDiego
Flyte kubecon 2019 SanDiego
 
Types Working for You, Not Against You
Types Working for You, Not Against YouTypes Working for You, Not Against You
Types Working for You, Not Against You
 
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docxJLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
 
Pres_python_talakhoury_26_09_2023.pdf
Pres_python_talakhoury_26_09_2023.pdfPres_python_talakhoury_26_09_2023.pdf
Pres_python_talakhoury_26_09_2023.pdf
 
Chapter 1 Class 12 Computer Science Unit 1
Chapter 1 Class 12 Computer Science Unit 1Chapter 1 Class 12 Computer Science Unit 1
Chapter 1 Class 12 Computer Science Unit 1
 
Revision of the basics of python1 (1).pdf
Revision of the basics of python1 (1).pdfRevision of the basics of python1 (1).pdf
Revision of the basics of python1 (1).pdf
 
OneTeam Media Server
OneTeam Media ServerOneTeam Media Server
OneTeam Media Server
 
INTRODUCTION TO FUNCTIONS IN PYTHON
INTRODUCTION TO FUNCTIONS IN PYTHONINTRODUCTION TO FUNCTIONS IN PYTHON
INTRODUCTION TO FUNCTIONS IN PYTHON
 
Adopting F# at SBTech
Adopting F# at SBTechAdopting F# at SBTech
Adopting F# at SBTech
 
Deep Anomaly Detection from Research to Production Leveraging Spark and Tens...
 Deep Anomaly Detection from Research to Production Leveraging Spark and Tens... Deep Anomaly Detection from Research to Production Leveraging Spark and Tens...
Deep Anomaly Detection from Research to Production Leveraging Spark and Tens...
 
Standard Libraries in Python Programming
Standard Libraries in Python ProgrammingStandard Libraries in Python Programming
Standard Libraries in Python Programming
 
Going open source with small teams
Going open source with small teamsGoing open source with small teams
Going open source with small teams
 
Flink internals web
Flink internals web Flink internals web
Flink internals web
 
PPt Revision of the basics of python1.pptx
PPt Revision of the basics of python1.pptxPPt Revision of the basics of python1.pptx
PPt Revision of the basics of python1.pptx
 
OneTeam Media Server
OneTeam Media ServerOneTeam Media Server
OneTeam Media Server
 
Patterns & Practices for Cloud-based Microservices
Patterns & Practices for Cloud-based MicroservicesPatterns & Practices for Cloud-based Microservices
Patterns & Practices for Cloud-based Microservices
 
C++ functions
C++ functionsC++ functions
C++ functions
 

More from Christoph Santschi

Was uns wirklich nährt
Was uns wirklich nährtWas uns wirklich nährt
Was uns wirklich nährt
Christoph Santschi
 
Yaml
YamlYaml
Json - ideal for data interchange
Json - ideal for data interchangeJson - ideal for data interchange
Json - ideal for data interchange
Christoph Santschi
 
Self Assembly
Self AssemblySelf Assembly
Self Assembly
Christoph Santschi
 
Wasser und die Biochemie des Menschen
Wasser und die Biochemie des MenschenWasser und die Biochemie des Menschen
Wasser und die Biochemie des Menschen
Christoph Santschi
 
Prinzipien funktionaler programmierung
Prinzipien funktionaler programmierungPrinzipien funktionaler programmierung
Prinzipien funktionaler programmierung
Christoph Santschi
 
Analyse-Methodik
Analyse-MethodikAnalyse-Methodik
Analyse-Methodik
Christoph Santschi
 
Ernaehrung und Gesundheit
Ernaehrung und GesundheitErnaehrung und Gesundheit
Ernaehrung und Gesundheit
Christoph Santschi
 
Schlafstoerung
SchlafstoerungSchlafstoerung
Schlafstoerung
Christoph Santschi
 
Enzyme
EnzymeEnzyme
Natürliche Schmerzmittel
Natürliche SchmerzmittelNatürliche Schmerzmittel
Natürliche Schmerzmittel
Christoph Santschi
 
Die w fragen
Die w fragenDie w fragen
Die w fragen
Christoph Santschi
 
Vitamin D - das Sonnenvitamin
Vitamin D - das SonnenvitaminVitamin D - das Sonnenvitamin
Vitamin D - das Sonnenvitamin
Christoph Santschi
 
Standortbestimmung Ernährung - Wo sind wir?
Standortbestimmung Ernährung - Wo sind wir?Standortbestimmung Ernährung - Wo sind wir?
Standortbestimmung Ernährung - Wo sind wir?
Christoph Santschi
 
Ad(h)s und Ernaehrung
Ad(h)s und ErnaehrungAd(h)s und Ernaehrung
Ad(h)s und Ernaehrung
Christoph Santschi
 
Projektmanagement
ProjektmanagementProjektmanagement
Projektmanagement
Christoph Santschi
 

More from Christoph Santschi (16)

Was uns wirklich nährt
Was uns wirklich nährtWas uns wirklich nährt
Was uns wirklich nährt
 
Yaml
YamlYaml
Yaml
 
Json - ideal for data interchange
Json - ideal for data interchangeJson - ideal for data interchange
Json - ideal for data interchange
 
Self Assembly
Self AssemblySelf Assembly
Self Assembly
 
Wasser und die Biochemie des Menschen
Wasser und die Biochemie des MenschenWasser und die Biochemie des Menschen
Wasser und die Biochemie des Menschen
 
Prinzipien funktionaler programmierung
Prinzipien funktionaler programmierungPrinzipien funktionaler programmierung
Prinzipien funktionaler programmierung
 
Analyse-Methodik
Analyse-MethodikAnalyse-Methodik
Analyse-Methodik
 
Ernaehrung und Gesundheit
Ernaehrung und GesundheitErnaehrung und Gesundheit
Ernaehrung und Gesundheit
 
Schlafstoerung
SchlafstoerungSchlafstoerung
Schlafstoerung
 
Enzyme
EnzymeEnzyme
Enzyme
 
Natürliche Schmerzmittel
Natürliche SchmerzmittelNatürliche Schmerzmittel
Natürliche Schmerzmittel
 
Die w fragen
Die w fragenDie w fragen
Die w fragen
 
Vitamin D - das Sonnenvitamin
Vitamin D - das SonnenvitaminVitamin D - das Sonnenvitamin
Vitamin D - das Sonnenvitamin
 
Standortbestimmung Ernährung - Wo sind wir?
Standortbestimmung Ernährung - Wo sind wir?Standortbestimmung Ernährung - Wo sind wir?
Standortbestimmung Ernährung - Wo sind wir?
 
Ad(h)s und Ernaehrung
Ad(h)s und ErnaehrungAd(h)s und Ernaehrung
Ad(h)s und Ernaehrung
 
Projektmanagement
ProjektmanagementProjektmanagement
Projektmanagement
 

Recently uploaded

UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..
UiPathCommunity
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Enhancing Performance with Globus and the Science DMZ
Enhancing Performance with Globus and the Science DMZEnhancing Performance with Globus and the Science DMZ
Enhancing Performance with Globus and the Science DMZ
Globus
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 

Recently uploaded (20)

UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
 
UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Enhancing Performance with Globus and the Science DMZ
Enhancing Performance with Globus and the Science DMZEnhancing Performance with Globus and the Science DMZ
Enhancing Performance with Globus and the Science DMZ
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 

F sharp - an overview

  • 1. F# 3.0: Strongly Typed Programming in the Information Rich World
  • 2. Proposition 1 The world is incredibly information-rich Christoph Santschi – dipl. Natw. ETHZ
  • 3. Proposition 2 Modern financial enterprises are incredibly information-rich
  • 4. Proposition 3 Our languages are information- sparse
  • 5. Proposition 4 This is a Problem (especially for strongly typed Programming)
  • 6. With F# we want to help fix this... The mechanism we're adding to F# is called Type Providers
  • 7. LINQ + Type Providers = Language Integrated Data and Services
  • 8. F#is... ...a practical, supported, interoperable, functional language that allows you to write simple code to solve complex problems.
  • 9. Crossing boundaries “Fresh Code” Performance Professional Development Expressivity for Programming Mathematical tasks C++ C# Java Programming F# Python ... Financial engineering Algorithmic Trading DSL programming Math‐ ... ematica QF modelling
  • 10. Why is F# appealing in finance?  Functional programming fits with financial work – Programmatic modelling – Compositional parallel & GPU programming – Domain specific languages – internal and external – Efficient execution  Plays differently for different roles: – Quants contribute to component development – Architects explore hard problems fluently – Developers tackle parallel and async programming
  • 11.
  • 12. Simplicity: Functions as Values abstract class Command { public virtual void Execute(); } abstract class RoverCommand : Command { protected Rover Rover { get; private set; public RoverCommand(MarsRover rover) { this.Rover = rover; } } class BreakCommand : RoverCommand { public BreakCommand(Rover rover) : base(rover { } public override void Execute() { Rover.Rotate(-5.ø); } } class TurnLeftCommand : RoverCommand { } type Command = Command of (Rover -> unit) let BreakCommand = Command(fun rover -> rover.Accelerate(-1.ø)) let TurnLeftCommand = Command(fun rover -> rover.Rotate(-5.ø<degs>)) public TurnLeftCommand(Rover rover) : base(ro { } public override void Execute() { Rover.Rotate(-5.ø); }
  • 13. Simplicity: Functional Data Tuple<U,T> Swap<T,U>(Tuple<T,U> t) { return new Tuple<U,T>(t.Item2, t.Item1) } } let reduce f (x, y, z) = f x + f y + f z return f(t.Item1) + f(t.Item2) + f (t.Item3); C# ReadOnlyCollection<Tuple<T,T,T>> Rotations<T>(Tuple<T,T,T> t) { new ReadOnlyCollection<int> (new Tuple<T,T,T>[] { new Tuple<T,T,T>(t.Item1,t.Item2,t.Item3); new Tuple<T,T,T>(t.Item3,t.Item1,t.Item2); new Tuple<T,T,T>(t.Item2,t.Item3,t.Item1); }); let rotations (x, y, z) = [ (x, y, z); (z, x, y); (y, z, x) ] } int Reduce<T>(Func<T,int> f,Tuple<T,T,T> t) { let swap (x, y) = (y, x)
  • 14. Examples #2/#3: Finance companies Insurance Company Improves Time-to- Market with Enhanced Rating Engine Grange OV er ;eW Country or Region: UnitedStates Industry: Financial services—Insurance Customer Profile Headquartered in Co I umb us, Ohio, GrargeInsurance offers automobile, home,and business insurance protection to po I icyho Iders in 13 US. states.It em ploys 1,500 people. Business Situation To maintain its compefitivestancling and ifsreputationarnorg agents for beim] easyto do business with, Orange Insurance needed to keep its rating erkgineworking attop performarKe. Solulieff Llsi ng M icrosoftle Visua I Stud 'Off Tea m SystemandVisualF:rf,thecompany Insurance "With this streamlined development cycl rapidly deliver more powerful solutionsl they can deliver more choices and bette policyholdersthat much faster." GlennWaton, Associate Vice President, Personal Li nes, IT, Orange For nearly 75 years, Grange Insurance has offer products and services to policyholders in more states. To maintain its well-earned reputation company decided to enhance its rating engine- for rating policies and performing what-if modi analyses, and other vital activities. Working wit Group and using the Microsoft! Visual Studio! development environment and Microsoft ViSLIE ming language, Grange Insurance parallelized i husto men. Financial services firm Country or Region: Europe Industry: Financial services—Banking Customer Profile A la rge Europeanfinancial services firm offers banking and asset-management services to clients in 50 countries. In 2004, the bank earned morethan 11.5.$6 billion in income. SoftwareandServices  MicrosoftVisual Studio  MicrosoftVisual  MicrosoftVisualStudio2010  Technologies  Microsoft .NET Framework  WindowsPresentationFoundation Banking Firm Uses Functional Language to Speed Development by 50 Percent "VVe could not have developed 200 models in two yearswithout F# and Visual Studio. lt would have taken us at least twice as lang with our previaustools." Directerata la rge Europeant na ncia I servicefirm A large financial services firm in Europe sought new development tools that could cut costs, boost productivity, and improvethe quality of its mathematical models. To address its needs, the bank deployed Microsoft F#, the Microsoft .NET Framework, and Microsoft Visual Studio. It will sonn upgrade to Visual Studio 2010 and the integrated Microsoft Visual F#. With its new tools, the bank can speed development by 50 percent or more, improve quality, and reduce costs. Business Needs desktop and ona remotecluster of senyers
  • 15. A Typeprovide is: “A compile-time component that provides a computed space of types and methods on-demand ...” “A compiler plug-in...” “An adaptor between data/services and the .NET type system...”
  • 16. // Freebase.fsx // Example of reading from freebase.com in F# // by Jomo Fisher #r "System.Runtime.Serial #r "System.ServiceModel.Wbl #r "System.Web" #r "System.Xml" " et Query<'T>(query:string) : 'T = let query = query.Replace("'",""") let queryUrl = sprintf "http://api.freebase.com/api/service/mqlread?query=%s" "{"query":"+query+"}" open System open System.IO open System.Netopen System.Text open System.Web open System.Security.Authation let response = request.GetResponse() open System.Runtime.Seria let request : HttpWebRequest = downcast WebRequest.Create(queryUrl) request.Method <- "GET"request.ContentType <- "application/x-www-form-urncoded" How would we do this previously? [<DataContract>] type Result<'TResult> = { [<field: DataMember(N Code:string [<field: DataMember(N re> Result:'TResult [<field: DataMember(Nmessage"let data = Message:string } let result = try use reader = new StreamReader(response.GetResponseStream()) ] reader.ReadToEnd(); finally ] sponse.Close() ] Encoding.Unicode.GetBytes(result); let stream = new MemoryStream() stream.Write(data, 0, data.Length); stream.Position <- 0L [<DataContract>] type ChemicalElement = { [<field: DataMember(Nname")let resu> Name:string [<field: DataMember(Ningpoint")raise (Invali > let ser = Json.DataContractJsonSerializer(typeof<Result<'T>>) ] lt = ser.ReadObject(stream) :?> Result<'T> if result.Code<>"/api/status/ok" then ] dOperationException(result.Message)) BoilingPoint:string else [<field: DataMember(Nicmass")result.Result>] AtomicMass:string } let elements = Query<ChemicalElement array>("[{'type':'/chemistry/chemical_element','name':null,'boiling_point':null,'atomic_mass ':null}]") elements |> Array.iter(fun element->printfn "%A" element)
  • 17. Note: F# itself still contains no data Open architecture You can write your own type provider
  • 19. SQL
  • 20. Web Services type Data = WsdlService<uhttp://teny. xignite • c ornixF ut ures .asmx?WSDL" let financials = DataiGetServiceContext() financials.GetQuotes "IBM" Fluent Typed Access To WSDL
  • 21. F# 3.0: Queries let avatarTitles = query { for t in netflix.Titles do where (t.Name.Contains "Avatar") select t } let avatarTitles = query { for t in netflix.Titles do where (t.Name.Contains "Avatar") sortBy t.Name select t } let avatarTitles = query { for t in netflix.Titles do where (t.Name.Contains "Avatar") sortBy t.Name select t take 100 }
  • 22. Conclusion 1 Huge Information Spaces can be Software Components
  • 23. Conclusion 2 Multiple data standards with one simple mechanism
  • 24. Conclusion 3 Integrated Data Access Empowers Both Programmers and Analysts
  • 25. Summary The financial world is massively information rich Our enterprise financial programming needs to be information‐rich too Information‐richness changes how we think about programming and analysis