SlideShare a Scribd company logo
Information-rich programming in
                  F#




                  Tomas Petricek, University of Cambridge
                   Don Syme and the F# team, Microsoft


ML Workshop (Copenhagen, 13 September, 2012)
The confusion of languages
The confusion of languages
What is a type provider?
DEMO: Accessing World Bank



Comparing university enrollment rate in
  Czech Republic and OECD countries
Problems with data access

Data is not types with members
 Use dynamic languages?

Need to know names of properties
 Use code generation and static languages?

Enormous scale of data sources
 Types need to be generated “on demand”
Components of a type provider

            Type provider

    IDE                  Compiler
IntelliSense for     Type-Check     Compile using
Provided Types     Provided Types   Type Provider
Research problems
Mapping data sources to types
  What is a type? What is a value?

Types are provided on demand
  Cannot generate all indicator types at once!

Representing data source properties as types
  Physical units, provenance, temporal properties

Adapting to schema change
  Type soundness is relative w.r.t. data source changes
Mapping data source to types



Country




  Indicator     Year
Research problems
Mapping data sources to types
  What is a type? What is a value?

Types are provided on demand
  Cannot generate all indicator types at once!

Representing data source properties as types
  Physical units, provenance, temporal properties

Adapting to schema change
  Type soundness is relative w.r.t. data source changes
Gamma, The Forgotten
Standard typing judgments


Gamma on steroids
            Γ = …,   WB.DataContext
  WB.DataContext = Countries : delay (…)
                               Country list

Reducing delayed context
Research problems
Mapping data sources to types
  What is a type? What is a value?

Types are provided on demand
  Cannot generate all indicator types at once!

Representing data source properties as types
  Physical units, provenance, temporal properties

Adapting to schema change
  Type soundness is relative w.r.t. data source changes
DEMO: XML Type Provider



  Working with XML data and
  adapting to schema change
Related Work

Compile-time meta-programming
 Types generated eagerly, not on demand

Dependently typed languages
 Type-level computation in the IO monad??

Multi-stage computations
 Focus on performance vs. data access
For more information

Upcoming technical report
 Don Syme, et al. Strongly-Typed Language
 Support for an Information-Rich World

Workshop on related topics
 Data Driven Functional Programming
 Workshop, Co-located with POPL 2013
Summary

Mismatch between data and types
 Type providers bridge the gap
 Development-time, compile-time & run-time

Interesting future questions
 Relative type safety and schema change
 Capturing meta-data with types
Research problems
Mapping data sources to types
  What is a type? What is a value?

Types are provided on demand
  Cannot generate all indicator types at once!

Representing data source properties as types
  Physical units, provenance, temporal properties

Adapting to schema change
  Type soundness is relative w.r.t. data source changes
DEMO: FreeBase Type Provider



    Working with chemistry data
       and units of measure
Structure of a Simple Provider
[<TypeProvider>]
type SampleTypeProvider(config: TypeProviderConfig) =
  inherit TypeProviderForNamespaces()

 // Define new type Samples.GeneratedType
 let thisAssembly = Assembly.GetExecutingAssembly()
 let providedType = ProvidedTypeDefinition( ... )
 do
   // Add property 'Hello' that just returns a string
   ProvidedProperty
     ( "Hello", typeof<string>, IsStatic = true,
       GetterCode = fun args -> <@@ Runtime.lookup "Hello" @@>)
   |> providedType.AddMember

   // Register the type with the compiler
   this.AddNamespace(namespaceName, [ providedType ])
Compile-Time vs. Run-time

Type Provider



      Runtime API      Provider

                                     Accesses
                                                 Data
                    Generates                   source
             Uses                    Accesses

                     Provided code
Executable
Compile-Time vs. Run-time

Type Provider



      Runtime API      Provider

                                     Accesses
                                                 Data
                    Generates                   source


                     Provided code
Executable
Queries in F#

Can be turned to quotations
    query { for movie in netflix.Titles do
            where (movie.Name.Contains(search))
            select movie }



Extensible query language
    query { for index in Numbers do
            reverse
            takeWhile index > 10 }

More Related Content

What's hot

Exposing RDF Archives using Triple Pattern Fragments
Exposing RDF Archives using Triple Pattern FragmentsExposing RDF Archives using Triple Pattern Fragments
Exposing RDF Archives using Triple Pattern Fragments
Ruben Taelman
 
Qald 7 at ESWC2017
Qald 7 at ESWC2017Qald 7 at ESWC2017
Qald 7 at ESWC2017
Giulio Napolitano
 
QALD-7 Question Answering over Linked Data Challenge
QALD-7 Question Answering over Linked Data ChallengeQALD-7 Question Answering over Linked Data Challenge
QALD-7 Question Answering over Linked Data Challenge
Holistic Benchmarking of Big Linked Data
 
Benchmark BIB-R @ TPDL 2016
Benchmark BIB-R @ TPDL 2016Benchmark BIB-R @ TPDL 2016
Benchmark BIB-R @ TPDL 2016
Joffrey DECOURSELLE
 
Crowdsourcing the Quality of Knowledge Graphs: A DBpedia Study
Crowdsourcing the Quality of Knowledge Graphs:A DBpedia StudyCrowdsourcing the Quality of Knowledge Graphs:A DBpedia Study
Crowdsourcing the Quality of Knowledge Graphs: A DBpedia Study
Maribel Acosta Deibe
 
Milex 2010 final
Milex 2010 finalMilex 2010 final
Milex 2010 final
Albert S. Cook Library
 
Sparklis exploration et interrogation de points d'accès sparql par interactio...
Sparklis exploration et interrogation de points d'accès sparql par interactio...Sparklis exploration et interrogation de points d'accès sparql par interactio...
Sparklis exploration et interrogation de points d'accès sparql par interactio...
SemWebPro
 
Open ONI and IIIF: NDNP data in an IIIF Viewer
Open ONI and IIIF: NDNP data in an IIIF ViewerOpen ONI and IIIF: NDNP data in an IIIF Viewer
Open ONI and IIIF: NDNP data in an IIIF Viewer
Karen Estlund
 
A Closer Look at the Changing Dynamics of DBpedia Mappings
A Closer Look at the Changing Dynamics of DBpedia MappingsA Closer Look at the Changing Dynamics of DBpedia Mappings
A Closer Look at the Changing Dynamics of DBpedia Mappings
Maribel Acosta Deibe
 
Newspapers, IIIF, and ALTO
Newspapers, IIIF, and ALTONewspapers, IIIF, and ALTO
Newspapers, IIIF, and ALTO
Karen Estlund
 
Topical_Facets
Topical_FacetsTopical_Facets
Topical_Facets
Eric Van Horenbeeck
 
Creating a FRBRized Data Structure in XML
Creating a FRBRized Data Structure in XMLCreating a FRBRized Data Structure in XML
Creating a FRBRized Data Structure in XML
Jenn Riley
 
Oles Petriv “Creating one concept embedding space for persons, brands and new...
Oles Petriv “Creating one concept embedding space for persons, brands and new...Oles Petriv “Creating one concept embedding space for persons, brands and new...
Oles Petriv “Creating one concept embedding space for persons, brands and new...
Lviv Startup Club
 
Healthcare Data Management using Domain Specific Languages for Metadata Manag...
Healthcare Data Management using Domain Specific Languages for Metadata Manag...Healthcare Data Management using Domain Specific Languages for Metadata Manag...
Healthcare Data Management using Domain Specific Languages for Metadata Manag...
David Milward
 
Link Discovery Tutorial Introduction
Link Discovery Tutorial IntroductionLink Discovery Tutorial Introduction
Link Discovery Tutorial Introduction
Holistic Benchmarking of Big Linked Data
 
Entity Retrieval (WSDM 2014 tutorial)
Entity Retrieval (WSDM 2014 tutorial)Entity Retrieval (WSDM 2014 tutorial)
Entity Retrieval (WSDM 2014 tutorial)
krisztianbalog
 
Analyzing poetry databases to develop a metadata application profile. Why eac...
Analyzing poetry databases to develop a metadata application profile. Why eac...Analyzing poetry databases to develop a metadata application profile. Why eac...
Analyzing poetry databases to develop a metadata application profile. Why eac...
Uned Laboratorio de Innovación en Humanidades
 
Entity Retrieval (SIGIR 2013 tutorial)
Entity Retrieval (SIGIR 2013 tutorial)Entity Retrieval (SIGIR 2013 tutorial)
Entity Retrieval (SIGIR 2013 tutorial)
krisztianbalog
 
Link Discovery Tutorial Part III: Benchmarking for Instance Matching Systems
Link Discovery Tutorial Part III: Benchmarking for Instance Matching SystemsLink Discovery Tutorial Part III: Benchmarking for Instance Matching Systems
Link Discovery Tutorial Part III: Benchmarking for Instance Matching Systems
Holistic Benchmarking of Big Linked Data
 
Pattern-based Acquisition of Scientific Entities from Scholarly Article Title...
Pattern-based Acquisition of Scientific Entities from Scholarly Article Title...Pattern-based Acquisition of Scientific Entities from Scholarly Article Title...
Pattern-based Acquisition of Scientific Entities from Scholarly Article Title...
Jennifer D'Souza
 

What's hot (20)

Exposing RDF Archives using Triple Pattern Fragments
Exposing RDF Archives using Triple Pattern FragmentsExposing RDF Archives using Triple Pattern Fragments
Exposing RDF Archives using Triple Pattern Fragments
 
Qald 7 at ESWC2017
Qald 7 at ESWC2017Qald 7 at ESWC2017
Qald 7 at ESWC2017
 
QALD-7 Question Answering over Linked Data Challenge
QALD-7 Question Answering over Linked Data ChallengeQALD-7 Question Answering over Linked Data Challenge
QALD-7 Question Answering over Linked Data Challenge
 
Benchmark BIB-R @ TPDL 2016
Benchmark BIB-R @ TPDL 2016Benchmark BIB-R @ TPDL 2016
Benchmark BIB-R @ TPDL 2016
 
Crowdsourcing the Quality of Knowledge Graphs: A DBpedia Study
Crowdsourcing the Quality of Knowledge Graphs:A DBpedia StudyCrowdsourcing the Quality of Knowledge Graphs:A DBpedia Study
Crowdsourcing the Quality of Knowledge Graphs: A DBpedia Study
 
Milex 2010 final
Milex 2010 finalMilex 2010 final
Milex 2010 final
 
Sparklis exploration et interrogation de points d'accès sparql par interactio...
Sparklis exploration et interrogation de points d'accès sparql par interactio...Sparklis exploration et interrogation de points d'accès sparql par interactio...
Sparklis exploration et interrogation de points d'accès sparql par interactio...
 
Open ONI and IIIF: NDNP data in an IIIF Viewer
Open ONI and IIIF: NDNP data in an IIIF ViewerOpen ONI and IIIF: NDNP data in an IIIF Viewer
Open ONI and IIIF: NDNP data in an IIIF Viewer
 
A Closer Look at the Changing Dynamics of DBpedia Mappings
A Closer Look at the Changing Dynamics of DBpedia MappingsA Closer Look at the Changing Dynamics of DBpedia Mappings
A Closer Look at the Changing Dynamics of DBpedia Mappings
 
Newspapers, IIIF, and ALTO
Newspapers, IIIF, and ALTONewspapers, IIIF, and ALTO
Newspapers, IIIF, and ALTO
 
Topical_Facets
Topical_FacetsTopical_Facets
Topical_Facets
 
Creating a FRBRized Data Structure in XML
Creating a FRBRized Data Structure in XMLCreating a FRBRized Data Structure in XML
Creating a FRBRized Data Structure in XML
 
Oles Petriv “Creating one concept embedding space for persons, brands and new...
Oles Petriv “Creating one concept embedding space for persons, brands and new...Oles Petriv “Creating one concept embedding space for persons, brands and new...
Oles Petriv “Creating one concept embedding space for persons, brands and new...
 
Healthcare Data Management using Domain Specific Languages for Metadata Manag...
Healthcare Data Management using Domain Specific Languages for Metadata Manag...Healthcare Data Management using Domain Specific Languages for Metadata Manag...
Healthcare Data Management using Domain Specific Languages for Metadata Manag...
 
Link Discovery Tutorial Introduction
Link Discovery Tutorial IntroductionLink Discovery Tutorial Introduction
Link Discovery Tutorial Introduction
 
Entity Retrieval (WSDM 2014 tutorial)
Entity Retrieval (WSDM 2014 tutorial)Entity Retrieval (WSDM 2014 tutorial)
Entity Retrieval (WSDM 2014 tutorial)
 
Analyzing poetry databases to develop a metadata application profile. Why eac...
Analyzing poetry databases to develop a metadata application profile. Why eac...Analyzing poetry databases to develop a metadata application profile. Why eac...
Analyzing poetry databases to develop a metadata application profile. Why eac...
 
Entity Retrieval (SIGIR 2013 tutorial)
Entity Retrieval (SIGIR 2013 tutorial)Entity Retrieval (SIGIR 2013 tutorial)
Entity Retrieval (SIGIR 2013 tutorial)
 
Link Discovery Tutorial Part III: Benchmarking for Instance Matching Systems
Link Discovery Tutorial Part III: Benchmarking for Instance Matching SystemsLink Discovery Tutorial Part III: Benchmarking for Instance Matching Systems
Link Discovery Tutorial Part III: Benchmarking for Instance Matching Systems
 
Pattern-based Acquisition of Scientific Entities from Scholarly Article Title...
Pattern-based Acquisition of Scientific Entities from Scholarly Article Title...Pattern-based Acquisition of Scientific Entities from Scholarly Article Title...
Pattern-based Acquisition of Scientific Entities from Scholarly Article Title...
 

Viewers also liked

Tele3113 tut3
Tele3113 tut3Tele3113 tut3
Tele3113 tut3
Vin Voro
 
Worshop
WorshopWorshop
Worshop
oiwan
 
Tele3113 tut5
Tele3113 tut5Tele3113 tut5
Tele3113 tut5
Vin Voro
 
19 structured files
19 structured files19 structured files
19 structured files
ashish61_scs
 
Lect08
Lect08Lect08
Lect08
Vin Voro
 
Tele3113 tut1
Tele3113 tut1Tele3113 tut1
Tele3113 tut1
Vin Voro
 
Design Decisions Securities Market
Design Decisions Securities MarketDesign Decisions Securities Market
Design Decisions Securities Market
Sandra Wills
 
Kwik Klik Hoarding Systems Presentation
Kwik Klik Hoarding Systems PresentationKwik Klik Hoarding Systems Presentation
Kwik Klik Hoarding Systems Presentation
JohnWhaites
 

Viewers also liked (8)

Tele3113 tut3
Tele3113 tut3Tele3113 tut3
Tele3113 tut3
 
Worshop
WorshopWorshop
Worshop
 
Tele3113 tut5
Tele3113 tut5Tele3113 tut5
Tele3113 tut5
 
19 structured files
19 structured files19 structured files
19 structured files
 
Lect08
Lect08Lect08
Lect08
 
Tele3113 tut1
Tele3113 tut1Tele3113 tut1
Tele3113 tut1
 
Design Decisions Securities Market
Design Decisions Securities MarketDesign Decisions Securities Market
Design Decisions Securities Market
 
Kwik Klik Hoarding Systems Presentation
Kwik Klik Hoarding Systems PresentationKwik Klik Hoarding Systems Presentation
Kwik Klik Hoarding Systems Presentation
 

Similar to Information-rich programming in F# (ML Workshop 2012)

Consuming Data with F# Type Providers
Consuming Data with F# Type ProvidersConsuming Data with F# Type Providers
Consuming Data with F# Type Providers
Rachel Reese
 
Language Server Protocol - Why the Hype?
Language Server Protocol - Why the Hype?Language Server Protocol - Why the Hype?
Language Server Protocol - Why the Hype?
mikaelbarbero
 
Integrating Xtext Language Server support in Visual Studio Code
Integrating Xtext Language Server support in Visual Studio CodeIntegrating Xtext Language Server support in Visual Studio Code
Integrating Xtext Language Server support in Visual Studio Code
Karsten Thoms
 
F# Type Provider for R Statistical Platform
F# Type Provider for R Statistical PlatformF# Type Provider for R Statistical Platform
F# Type Provider for R Statistical Platform
Howard Mansell
 
"Objects validation and comparison using runtime types (io-ts)", Oleksandr Suhak
"Objects validation and comparison using runtime types (io-ts)", Oleksandr Suhak"Objects validation and comparison using runtime types (io-ts)", Oleksandr Suhak
"Objects validation and comparison using runtime types (io-ts)", Oleksandr Suhak
Fwdays
 
Accessing loosely structured data from F# and C#
Accessing loosely structured data from F# and C#Accessing loosely structured data from F# and C#
Accessing loosely structured data from F# and C#
Tomas Petricek
 
michael hamilton legal database design presentation 3 new york
michael hamilton legal database design presentation 3 new yorkmichael hamilton legal database design presentation 3 new york
michael hamilton legal database design presentation 3 new york
michaelhamilton
 
seo tutorial
seo tutorialseo tutorial
seo tutorial
Aarti Sharma
 
Multi-language Content Discovery Through Entity Driven Search
Multi-language Content Discovery Through Entity Driven SearchMulti-language Content Discovery Through Entity Driven Search
Multi-language Content Discovery Through Entity Driven Search
Alessandro Benedetti
 
Java 5 PSM for DDS: Revised Submission (out of date)
Java 5 PSM for DDS: Revised Submission (out of date)Java 5 PSM for DDS: Revised Submission (out of date)
Java 5 PSM for DDS: Revised Submission (out of date)
Rick Warren
 
Adri Jovin - Semantic Web
Adri Jovin - Semantic WebAdri Jovin - Semantic Web
Adri Jovin - Semantic Web
Adri Jovin
 
NetBase API Presentation
NetBase API PresentationNetBase API Presentation
NetBase API Presentation
Netbase Solutions Inc.
 
Maintenance of Dynamically vs. Statically typed Languages
Maintenance of Dynamically vs. Statically typed LanguagesMaintenance of Dynamically vs. Statically typed Languages
Maintenance of Dynamically vs. Statically typed Languages
Amin Bandeali
 
.Net Session Overview
.Net Session Overview.Net Session Overview
.Net Session Overview
Logu Thanigachalam
 
Functional Requirements for an Interlinear Text Editor
Functional Requirements for an Interlinear Text EditorFunctional Requirements for an Interlinear Text Editor
Functional Requirements for an Interlinear Text Editor
Baden Hughes
 
Language Engineering With Xtext
Language Engineering With XtextLanguage Engineering With Xtext
Language Engineering With Xtext
Sven Efftinge
 
Creating Domain Specific Languages in F#
Creating Domain Specific Languages in F#Creating Domain Specific Languages in F#
Creating Domain Specific Languages in F#
Tomas Petricek
 
Compiler Construction | Lecture 17 | Beyond Compiler Construction
Compiler Construction | Lecture 17 | Beyond Compiler ConstructionCompiler Construction | Lecture 17 | Beyond Compiler Construction
Compiler Construction | Lecture 17 | Beyond Compiler Construction
Eelco Visser
 
Multi-language Content Discovery Through Entity Driven Search: Presented by A...
Multi-language Content Discovery Through Entity Driven Search: Presented by A...Multi-language Content Discovery Through Entity Driven Search: Presented by A...
Multi-language Content Discovery Through Entity Driven Search: Presented by A...
Lucidworks
 
F# Type Providers in Depth
F# Type Providers in DepthF# Type Providers in Depth
F# Type Providers in Depth
Tomas Petricek
 

Similar to Information-rich programming in F# (ML Workshop 2012) (20)

Consuming Data with F# Type Providers
Consuming Data with F# Type ProvidersConsuming Data with F# Type Providers
Consuming Data with F# Type Providers
 
Language Server Protocol - Why the Hype?
Language Server Protocol - Why the Hype?Language Server Protocol - Why the Hype?
Language Server Protocol - Why the Hype?
 
Integrating Xtext Language Server support in Visual Studio Code
Integrating Xtext Language Server support in Visual Studio CodeIntegrating Xtext Language Server support in Visual Studio Code
Integrating Xtext Language Server support in Visual Studio Code
 
F# Type Provider for R Statistical Platform
F# Type Provider for R Statistical PlatformF# Type Provider for R Statistical Platform
F# Type Provider for R Statistical Platform
 
"Objects validation and comparison using runtime types (io-ts)", Oleksandr Suhak
"Objects validation and comparison using runtime types (io-ts)", Oleksandr Suhak"Objects validation and comparison using runtime types (io-ts)", Oleksandr Suhak
"Objects validation and comparison using runtime types (io-ts)", Oleksandr Suhak
 
Accessing loosely structured data from F# and C#
Accessing loosely structured data from F# and C#Accessing loosely structured data from F# and C#
Accessing loosely structured data from F# and C#
 
michael hamilton legal database design presentation 3 new york
michael hamilton legal database design presentation 3 new yorkmichael hamilton legal database design presentation 3 new york
michael hamilton legal database design presentation 3 new york
 
seo tutorial
seo tutorialseo tutorial
seo tutorial
 
Multi-language Content Discovery Through Entity Driven Search
Multi-language Content Discovery Through Entity Driven SearchMulti-language Content Discovery Through Entity Driven Search
Multi-language Content Discovery Through Entity Driven Search
 
Java 5 PSM for DDS: Revised Submission (out of date)
Java 5 PSM for DDS: Revised Submission (out of date)Java 5 PSM for DDS: Revised Submission (out of date)
Java 5 PSM for DDS: Revised Submission (out of date)
 
Adri Jovin - Semantic Web
Adri Jovin - Semantic WebAdri Jovin - Semantic Web
Adri Jovin - Semantic Web
 
NetBase API Presentation
NetBase API PresentationNetBase API Presentation
NetBase API Presentation
 
Maintenance of Dynamically vs. Statically typed Languages
Maintenance of Dynamically vs. Statically typed LanguagesMaintenance of Dynamically vs. Statically typed Languages
Maintenance of Dynamically vs. Statically typed Languages
 
.Net Session Overview
.Net Session Overview.Net Session Overview
.Net Session Overview
 
Functional Requirements for an Interlinear Text Editor
Functional Requirements for an Interlinear Text EditorFunctional Requirements for an Interlinear Text Editor
Functional Requirements for an Interlinear Text Editor
 
Language Engineering With Xtext
Language Engineering With XtextLanguage Engineering With Xtext
Language Engineering With Xtext
 
Creating Domain Specific Languages in F#
Creating Domain Specific Languages in F#Creating Domain Specific Languages in F#
Creating Domain Specific Languages in F#
 
Compiler Construction | Lecture 17 | Beyond Compiler Construction
Compiler Construction | Lecture 17 | Beyond Compiler ConstructionCompiler Construction | Lecture 17 | Beyond Compiler Construction
Compiler Construction | Lecture 17 | Beyond Compiler Construction
 
Multi-language Content Discovery Through Entity Driven Search: Presented by A...
Multi-language Content Discovery Through Entity Driven Search: Presented by A...Multi-language Content Discovery Through Entity Driven Search: Presented by A...
Multi-language Content Discovery Through Entity Driven Search: Presented by A...
 
F# Type Providers in Depth
F# Type Providers in DepthF# Type Providers in Depth
F# Type Providers in Depth
 

More from Tomas Petricek

Coeffects: A Calculus of Context-Dependent Computation
Coeffects: A Calculus of Context-Dependent ComputationCoeffects: A Calculus of Context-Dependent Computation
Coeffects: A Calculus of Context-Dependent Computation
Tomas Petricek
 
F# and Financial Data Making Data Analysis Simple
F# and Financial Data Making Data Analysis SimpleF# and Financial Data Making Data Analysis Simple
F# and Financial Data Making Data Analysis Simple
Tomas Petricek
 
Asynchronous programming in F# (QCon 2012)
Asynchronous programming in F# (QCon 2012)Asynchronous programming in F# (QCon 2012)
Asynchronous programming in F# (QCon 2012)
Tomas Petricek
 
Queries in general purpose languages
Queries in general purpose languagesQueries in general purpose languages
Queries in general purpose languages
Tomas Petricek
 
Docase notation for Haskell
Docase notation for HaskellDocase notation for Haskell
Docase notation for Haskell
Tomas Petricek
 
F# on the Server-Side
F# on the Server-SideF# on the Server-Side
F# on the Server-Side
Tomas Petricek
 
F# Tutorial @ QCon
F# Tutorial @ QConF# Tutorial @ QCon
F# Tutorial @ QCon
Tomas Petricek
 
Teaching F#
Teaching F#Teaching F#
Teaching F#
Tomas Petricek
 
F# in MonoDevelop
F# in MonoDevelopF# in MonoDevelop
F# in MonoDevelop
Tomas Petricek
 
Academia
AcademiaAcademia
Academia
Tomas Petricek
 
Concurrent programming with Agents
Concurrent programming with AgentsConcurrent programming with Agents
Concurrent programming with Agents
Tomas Petricek
 

More from Tomas Petricek (11)

Coeffects: A Calculus of Context-Dependent Computation
Coeffects: A Calculus of Context-Dependent ComputationCoeffects: A Calculus of Context-Dependent Computation
Coeffects: A Calculus of Context-Dependent Computation
 
F# and Financial Data Making Data Analysis Simple
F# and Financial Data Making Data Analysis SimpleF# and Financial Data Making Data Analysis Simple
F# and Financial Data Making Data Analysis Simple
 
Asynchronous programming in F# (QCon 2012)
Asynchronous programming in F# (QCon 2012)Asynchronous programming in F# (QCon 2012)
Asynchronous programming in F# (QCon 2012)
 
Queries in general purpose languages
Queries in general purpose languagesQueries in general purpose languages
Queries in general purpose languages
 
Docase notation for Haskell
Docase notation for HaskellDocase notation for Haskell
Docase notation for Haskell
 
F# on the Server-Side
F# on the Server-SideF# on the Server-Side
F# on the Server-Side
 
F# Tutorial @ QCon
F# Tutorial @ QConF# Tutorial @ QCon
F# Tutorial @ QCon
 
Teaching F#
Teaching F#Teaching F#
Teaching F#
 
F# in MonoDevelop
F# in MonoDevelopF# in MonoDevelop
F# in MonoDevelop
 
Academia
AcademiaAcademia
Academia
 
Concurrent programming with Agents
Concurrent programming with AgentsConcurrent programming with Agents
Concurrent programming with Agents
 

Recently uploaded

Essentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation ParametersEssentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation Parameters
Safe Software
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
Ajin Abraham
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
DianaGray10
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
Miro Wengner
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
Ivo Velitchkov
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
DianaGray10
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Harnessing the Power of NLP and Knowledge Graphs for Opioid Research
Harnessing the Power of NLP and Knowledge Graphs for Opioid ResearchHarnessing the Power of NLP and Knowledge Graphs for Opioid Research
Harnessing the Power of NLP and Knowledge Graphs for Opioid Research
Neo4j
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Neo4j
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
AstuteBusiness
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
Neo4j
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
Fwdays
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 

Recently uploaded (20)

Essentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation ParametersEssentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation Parameters
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Harnessing the Power of NLP and Knowledge Graphs for Opioid Research
Harnessing the Power of NLP and Knowledge Graphs for Opioid ResearchHarnessing the Power of NLP and Knowledge Graphs for Opioid Research
Harnessing the Power of NLP and Knowledge Graphs for Opioid Research
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
 
Artificial Intelligence and Electronic Warfare
Artificial Intelligence and Electronic WarfareArtificial Intelligence and Electronic Warfare
Artificial Intelligence and Electronic Warfare
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 

Information-rich programming in F# (ML Workshop 2012)

  • 1. Information-rich programming in F# Tomas Petricek, University of Cambridge Don Syme and the F# team, Microsoft ML Workshop (Copenhagen, 13 September, 2012)
  • 2. The confusion of languages
  • 3. The confusion of languages
  • 4. What is a type provider?
  • 5. DEMO: Accessing World Bank Comparing university enrollment rate in Czech Republic and OECD countries
  • 6. Problems with data access Data is not types with members Use dynamic languages? Need to know names of properties Use code generation and static languages? Enormous scale of data sources Types need to be generated “on demand”
  • 7. Components of a type provider Type provider IDE Compiler IntelliSense for Type-Check Compile using Provided Types Provided Types Type Provider
  • 8. Research problems Mapping data sources to types What is a type? What is a value? Types are provided on demand Cannot generate all indicator types at once! Representing data source properties as types Physical units, provenance, temporal properties Adapting to schema change Type soundness is relative w.r.t. data source changes
  • 9. Mapping data source to types Country Indicator Year
  • 10. Research problems Mapping data sources to types What is a type? What is a value? Types are provided on demand Cannot generate all indicator types at once! Representing data source properties as types Physical units, provenance, temporal properties Adapting to schema change Type soundness is relative w.r.t. data source changes
  • 11. Gamma, The Forgotten Standard typing judgments Gamma on steroids Γ = …, WB.DataContext WB.DataContext = Countries : delay (…) Country list Reducing delayed context
  • 12. Research problems Mapping data sources to types What is a type? What is a value? Types are provided on demand Cannot generate all indicator types at once! Representing data source properties as types Physical units, provenance, temporal properties Adapting to schema change Type soundness is relative w.r.t. data source changes
  • 13. DEMO: XML Type Provider Working with XML data and adapting to schema change
  • 14. Related Work Compile-time meta-programming Types generated eagerly, not on demand Dependently typed languages Type-level computation in the IO monad?? Multi-stage computations Focus on performance vs. data access
  • 15. For more information Upcoming technical report Don Syme, et al. Strongly-Typed Language Support for an Information-Rich World Workshop on related topics Data Driven Functional Programming Workshop, Co-located with POPL 2013
  • 16. Summary Mismatch between data and types Type providers bridge the gap Development-time, compile-time & run-time Interesting future questions Relative type safety and schema change Capturing meta-data with types
  • 17. Research problems Mapping data sources to types What is a type? What is a value? Types are provided on demand Cannot generate all indicator types at once! Representing data source properties as types Physical units, provenance, temporal properties Adapting to schema change Type soundness is relative w.r.t. data source changes
  • 18. DEMO: FreeBase Type Provider Working with chemistry data and units of measure
  • 19. Structure of a Simple Provider [<TypeProvider>] type SampleTypeProvider(config: TypeProviderConfig) = inherit TypeProviderForNamespaces() // Define new type Samples.GeneratedType let thisAssembly = Assembly.GetExecutingAssembly() let providedType = ProvidedTypeDefinition( ... ) do // Add property 'Hello' that just returns a string ProvidedProperty ( "Hello", typeof<string>, IsStatic = true, GetterCode = fun args -> <@@ Runtime.lookup "Hello" @@>) |> providedType.AddMember // Register the type with the compiler this.AddNamespace(namespaceName, [ providedType ])
  • 20. Compile-Time vs. Run-time Type Provider Runtime API Provider Accesses Data Generates source Uses Accesses Provided code Executable
  • 21. Compile-Time vs. Run-time Type Provider Runtime API Provider Accesses Data Generates source Provided code Executable
  • 22. Queries in F# Can be turned to quotations query { for movie in netflix.Titles do where (movie.Name.Contains(search)) select movie } Extensible query language query { for index in Numbers do reverse takeWhile index > 10 }