Loving data with F#

176 views
116 views

Published on

Dive into F# type providers infrastructure

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
176
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Loving data with F#

  1. 1. Partners:
  2. 2. Valdis Iļjučonoks Technical Fellow, Software Architect Visual Studio ALM evangelist Microsoft MVP http://www.tech-fellow.net | @tech_fellow Geta AS, Tech Fellow Consulting, Latvian .Net UG valdis.iljuconoks@outlook.com
  3. 3. Loving data with F# Valdis Iļjučonoks
  4. 4. There are three kinds of lies: lies, damned lies, and statistics. -- Benjamin Disraeli
  5. 5. Information rich programming
  6. 6. Bring data source closer to program
  7. 7. Barrier to include data sources:  Need to represent data as types, properties and methods  Generated code must be replaced every time service reference is adjusted
  8. 8. Type Providers
  9. 9. From 1k feet:  Compile-time type provider  Erased or generated types approach  Data set schema as type info source
  10. 10. Driven by F# team and community
  11. 11. DbmlFile EdmxFile ODataService SqlDataConnection SqlEntityConnection WsdlService AppSettings Excel Graph Machine Management Math Regex Xaml Xrm Apiary Csv Freebase Json WorldBank Xml DGML Word Csv DataStore Hadoop/Hive/Hdfs HelloWorld Management MiniCvs Xrm FunScript …
  12. 12. {Demo image}
  13. 13. Json Provider
  14. 14. WorldBank Provider
  15. 15. Xml Provider
  16. 16. OData Service Provider
  17. 17. Is it worth to develop custom provider?
  18. 18.  Is schema available?  Will provider have enough usage it’s worthwhile to write?  Will schema change during coding?  Will it change during program execution?
  19. 19. Authoring TypeProvider
  20. 20.  Uses F# Code Quotations  AddMember()  AddMemberDelayed()
  21. 21. let t = ProvidedTypeDefinition(thisAssembly,namespaceName, "Type" + string n, baseType = Some typeof<obj>) let staticProp = ProvidedProperty(propertyName = "StaticProperty", propertyType = typeof<string>, IsStatic = true, GetterCode = (fun args -> <@@ "Hello!" @@>)) staticProp.AddXmlDocDelayed(fun () -> "This is a static property") t.AddMember staticProp
  22. 22. Type Providers
  23. 23. Bring data source closer to program
  24. 24. Feedback   
  25. 25. Partners:

×