type providers(from the very beginning to the implementation)
DESCRIPTION
http://www.meetup.com/fsharpminsk/events/214812192/TRANSCRIPT
Type Providers: from the very
beginning to the implementation
@sergey_tih
on
2014
An F# type provider is a component that provides types, properties, and methods for use
in your program.
An F# type provider is a component that provides types, properties, and methods for use
in your program.
As well as a compiler/IDE extension…
How it works in C# world:Codegen, codegen, codegen!
Source
• WCF
Services
• Database
• OData
• UI/XAML
Codegen
Tool
• svcutil.exe
• edmgen.ex
e
• datrasvcuti
l.exe
Types
+codeProgram
F# 3.0 Built-in Type Provides
• WsdlService• EdmxFile• ODataService
• DbmlFile (DBML file based)• SqlDataConnection (LINQ to SQL)• SqlEntityConnection (LINQ to Entities)
FSharp.Data
http://fsharp.github.io/FSharp.Data/
• CSV Type Provider• HTML Type Provider• JSON Type Provider• XML Type Provider• WorldBank Provider• Freebase Provider
DEM
O
JSON
WorldBan
k
HTML/WSD
L
Games
COM
R
R Type Provider: Neural Networks
DEMO: Apache Hive Type Provider
Roman Bugaev (@rbugaev)
Distinguished Technical Architect for
projects in cloud computing. Excellent
public-speaker and acknowledged
member of IT/Startup community.
Type Provides
• DBMLFILE
• EDMXFILE
• ODATASERVICE
• SQLDATACONNECTION
• SQLENTITYCONNECTION
• WSDLSERVICE
• APIARY
• CSV
• FREEBASE
• JSON
• WORLDBANK
• XML
• HTML
• DBPEDIA
• APPSETTINGS
• EXCEL
• GRAPH
• MACHINE
• MANAGEMENT
• MATH
• REGEX
• XAML
• XRM
• CRM
• RSS
• NUGET
• MAT
• DGML
• WORD
• DATASTORE
• HADOOP/HIVE/HDFS
• COM
• FUNSCRIPT
• R
• MATLAB
• IKVM
• PYTHON
• POWERSHELL
• AZURE
• S3
• GAMES
CODE QUOTATIONS
CODE QUOTATIONS: BASICS
CODE QUOTATIONS: BASICS
CODE QUOTATIONS: SPLICING
How to create New Type Provider
Before You Start
The type provider mechanism is
primarily designed for injecting
stable data and service
information spaces into the F#
programming experience.
materials are from MSDN
Before You Start
This mechanism isn’t designed
for injecting information spaces
whose schema changes during
program execution in ways that
are relevant to program logic.
materials are from MSDN
Before You Start: Ask yourself questions
• Do you have a schema for your information source? If so, what’s
the mapping into the F# and .NET type system?
• Can you use an existing (dynamically typed) API as a starting
point for your implementation?
• Will you and your organization have enough uses of the type
provider to make writing it worthwhile? Would a normal .NET
library meet your needs?
• How much will your schema change?
• Will it change during coding?
• Will it change between coding sessions?
• Will it change during program execution?
materials are from MSDN
F# Type Provider Starter Packhttps://github.com/fsprojects/FSharp.TypeProviders.StarterP
ack
@mavnn
Reference from NuGet:FSharp.TypeProviders.StarterPack
ZIP Provider
ZIP Provider
SAMPLE OF USAGE
DEMO
HOW DO I CREATE AN F# TYPE PROVIDER THAT CAN BE USED FROM
C#?
QUESTIONS?
THANK YOU!
Ask me @sergey_tihon
Ask about #FSharp
My turn to ask questions!
What Type Provider
would you like to
have?