SlideShare a Scribd company logo
1 of 34
Functional
Web Applications
using
F# and Suave
@TomasJansson
BEKK
Developer
Practice lead .NET
OsloFSharp/NNUG
Microsoft MVP
F# enthusiast
F#?
Flickr: Supportive / Scott Robinson/ Creative Commons
Solid foundation
Flickr: Lego Bricks/ Benjamin Esham / Creative Commons
Composability
Flickr: Lego Set 10143 Death Star Todesstern / Dude of Lego/ Creative Commons
Composability
Feedback
Why F# and
Web?
All applications are functions,
also web applications
Server
Request
Response
Server
Request Response
Function
Input Output
?
Suave is a lightweight, non-blocking web server. The non-
blocking I/O model is efficient and suitable for building fast,
scalable network applications. In fact, Suave is written in a
completely non-blocking fashion throughout. Suave runs on
Linux, OS X and Windows flawlessly.
https://suave.io/
HttpContext
WebPart
Combinators
HttpContext
WebPart
WebPart
Combinators
Combinators
… that create a WebPart from more primitive values
… that combine multiple WebParts to a single WebPart
Model (simplified)
fun funfun
1. Start with some functions or values
WebPartWebPartWebPart
Model (simplified)
fun funfun
1. Start with some functions or values
2. Apply one or more combinator to each function or value to create some WebParts
WebPart
Model (simplified)
1. Start with some functions or values
2. Apply one or more combinator to each function or value to create some WebParts
3. Apply a combinator to the WebParts to create a single WebPart (repeat if needed)
WebPartWebPartWebPart
fun funfun
Demo
Demo
http://fsharp.github.io/FAKE/http://fsprojects.github.io/Paket/
Paket FAKE
Summary
F# is awesome
The web is functional
Program the web
using Suave
Resources
https://suave.io/
https://github.com/SuaveIO/suave
https://www.gitbook.com/book/theimowski/suave-music-store/
https://github.com/mastoj/my-share
FP Lab Hour
Room 10 at 13:40
@TomasJansson
github.com/mastoj
slideshare.net/mastoj

More Related Content

What's hot

Introduction to Meteor - Worldwide Meteor Day
Introduction to Meteor - Worldwide Meteor DayIntroduction to Meteor - Worldwide Meteor Day
Introduction to Meteor - Worldwide Meteor DayM A Hossain Tonu
 
Cross Platform Mobile Development in C#
Cross Platform Mobile Development in C#Cross Platform Mobile Development in C#
Cross Platform Mobile Development in C#James Montemagno
 
Building Chatbots
Building ChatbotsBuilding Chatbots
Building ChatbotsTessa Mero
 
JavaScript as a First-Class Citizen on iOS 7
JavaScript as a First-Class Citizen on iOS 7JavaScript as a First-Class Citizen on iOS 7
JavaScript as a First-Class Citizen on iOS 7Kevin Whinnery
 
See the time on your wrist - Apple Watch presentation
See the time on your wrist - Apple Watch presentationSee the time on your wrist - Apple Watch presentation
See the time on your wrist - Apple Watch presentationLammert Westerhoff
 
WP REST API - Adding Your Own Endpoint
WP REST API - Adding Your Own EndpointWP REST API - Adding Your Own Endpoint
WP REST API - Adding Your Own EndpointKeanan Koppenhaver
 
AngularJS on Mobile with the Ionic Framework
AngularJS on Mobile with the Ionic FrameworkAngularJS on Mobile with the Ionic Framework
AngularJS on Mobile with the Ionic FrameworkTroy Miles
 
An Introduction to ReactNative
An Introduction to ReactNativeAn Introduction to ReactNative
An Introduction to ReactNativeMichał Taberski
 
Contextual Final
Contextual FinalContextual Final
Contextual Finalsandragrove
 
Write Better JavaScript
Write Better JavaScriptWrite Better JavaScript
Write Better JavaScriptKevin Whinnery
 
IBM Sametime 9 Installation Woes and Proactive Repairs by Keith Brooks
IBM Sametime 9 Installation Woes and Proactive Repairs by Keith BrooksIBM Sametime 9 Installation Woes and Proactive Repairs by Keith Brooks
IBM Sametime 9 Installation Woes and Proactive Repairs by Keith BrooksKeith Brooks
 
Developing Single Page Apps with Ember.js
Developing Single Page Apps with Ember.jsDeveloping Single Page Apps with Ember.js
Developing Single Page Apps with Ember.jsLeo Hernandez
 
OpenNTF Blast from ILUG 2007
OpenNTF Blast from ILUG 2007OpenNTF Blast from ILUG 2007
OpenNTF Blast from ILUG 2007Kevin Pettitt
 
Skip the IDE with PhoneGap Build
Skip the IDE with PhoneGap BuildSkip the IDE with PhoneGap Build
Skip the IDE with PhoneGap BuildTerry Ryan
 
Make web as webapp
Make web as webappMake web as webapp
Make web as webappFred Lin
 
Merging two big Symfony based applications - SymfonyCon 2017
Merging two big Symfony based applications - SymfonyCon 2017Merging two big Symfony based applications - SymfonyCon 2017
Merging two big Symfony based applications - SymfonyCon 2017Ivo Lukac
 
Tipping the scale - Eyal Eizenberg - Wix
Tipping the scale - Eyal Eizenberg - WixTipping the scale - Eyal Eizenberg - Wix
Tipping the scale - Eyal Eizenberg - WixEyal Eizenberg
 
Live Coverage at The New York Times
Live Coverage at The New York TimesLive Coverage at The New York Times
Live Coverage at The New York TimesScott Taylor
 

What's hot (20)

Introduction to Meteor - Worldwide Meteor Day
Introduction to Meteor - Worldwide Meteor DayIntroduction to Meteor - Worldwide Meteor Day
Introduction to Meteor - Worldwide Meteor Day
 
Cross Platform Mobile Development in C#
Cross Platform Mobile Development in C#Cross Platform Mobile Development in C#
Cross Platform Mobile Development in C#
 
Building Chatbots
Building ChatbotsBuilding Chatbots
Building Chatbots
 
JavaScript as a First-Class Citizen on iOS 7
JavaScript as a First-Class Citizen on iOS 7JavaScript as a First-Class Citizen on iOS 7
JavaScript as a First-Class Citizen on iOS 7
 
Chatbots
ChatbotsChatbots
Chatbots
 
See the time on your wrist - Apple Watch presentation
See the time on your wrist - Apple Watch presentationSee the time on your wrist - Apple Watch presentation
See the time on your wrist - Apple Watch presentation
 
WP REST API - Adding Your Own Endpoint
WP REST API - Adding Your Own EndpointWP REST API - Adding Your Own Endpoint
WP REST API - Adding Your Own Endpoint
 
AngularJS on Mobile with the Ionic Framework
AngularJS on Mobile with the Ionic FrameworkAngularJS on Mobile with the Ionic Framework
AngularJS on Mobile with the Ionic Framework
 
An Introduction to ReactNative
An Introduction to ReactNativeAn Introduction to ReactNative
An Introduction to ReactNative
 
Contextual Final
Contextual FinalContextual Final
Contextual Final
 
Write Better JavaScript
Write Better JavaScriptWrite Better JavaScript
Write Better JavaScript
 
IBM Sametime 9 Installation Woes and Proactive Repairs by Keith Brooks
IBM Sametime 9 Installation Woes and Proactive Repairs by Keith BrooksIBM Sametime 9 Installation Woes and Proactive Repairs by Keith Brooks
IBM Sametime 9 Installation Woes and Proactive Repairs by Keith Brooks
 
Developing Single Page Apps with Ember.js
Developing Single Page Apps with Ember.jsDeveloping Single Page Apps with Ember.js
Developing Single Page Apps with Ember.js
 
OpenNTF Blast from ILUG 2007
OpenNTF Blast from ILUG 2007OpenNTF Blast from ILUG 2007
OpenNTF Blast from ILUG 2007
 
Skip the IDE with PhoneGap Build
Skip the IDE with PhoneGap BuildSkip the IDE with PhoneGap Build
Skip the IDE with PhoneGap Build
 
Make web as webapp
Make web as webappMake web as webapp
Make web as webapp
 
Merging two big Symfony based applications - SymfonyCon 2017
Merging two big Symfony based applications - SymfonyCon 2017Merging two big Symfony based applications - SymfonyCon 2017
Merging two big Symfony based applications - SymfonyCon 2017
 
Tipping the scale - Eyal Eizenberg - Wix
Tipping the scale - Eyal Eizenberg - WixTipping the scale - Eyal Eizenberg - Wix
Tipping the scale - Eyal Eizenberg - Wix
 
Build social apps for Facebook
Build social apps for FacebookBuild social apps for Facebook
Build social apps for Facebook
 
Live Coverage at The New York Times
Live Coverage at The New York TimesLive Coverage at The New York Times
Live Coverage at The New York Times
 

Similar to Functional webapplicaations using fsharp and suave

Building Better Web Apps with F#
Building Better Web Apps with F#Building Better Web Apps with F#
Building Better Web Apps with F#dmohl
 
Developing FirefoxOS
Developing FirefoxOSDeveloping FirefoxOS
Developing FirefoxOSFred Lin
 
Bay NET Aug 19 2009 presentation ppt
Bay  NET Aug 19 2009 presentation pptBay  NET Aug 19 2009 presentation ppt
Bay NET Aug 19 2009 presentation pptArt Scott
 
Building Better Web Apps with F#
Building Better Web Apps with F#Building Better Web Apps with F#
Building Better Web Apps with F#Dan Mohl
 
Videogram - Building a product with Sencha Touch
Videogram - Building a product with Sencha TouchVideogram - Building a product with Sencha Touch
Videogram - Building a product with Sencha TouchAlexander Wilhelm
 
Top 11 Front-End Web Development Tools To Consider in 2020
 Top 11 Front-End Web Development Tools To Consider in 2020 Top 11 Front-End Web Development Tools To Consider in 2020
Top 11 Front-End Web Development Tools To Consider in 2020Katy Slemon
 
Building windows phone_apps_-_a_developers_guide_v7_no_cover
Building windows phone_apps_-_a_developers_guide_v7_no_coverBuilding windows phone_apps_-_a_developers_guide_v7_no_cover
Building windows phone_apps_-_a_developers_guide_v7_no_coverPhan Sanh
 
Domain Modeling & Full-Stack Web Development F#
Domain Modeling & Full-Stack Web Development F#Domain Modeling & Full-Stack Web Development F#
Domain Modeling & Full-Stack Web Development F#Kevin Avignon
 
Lightning In The Clouds
Lightning In The CloudsLightning In The Clouds
Lightning In The Cloudsgeorge.james
 
What is Codename One - Transcript.pdf
What is Codename One - Transcript.pdfWhat is Codename One - Transcript.pdf
What is Codename One - Transcript.pdfShaiAlmog1
 
LAP II - Lezione 01 Introduzione al corso
LAP II - Lezione 01   Introduzione al corsoLAP II - Lezione 01   Introduzione al corso
LAP II - Lezione 01 Introduzione al corsoUniversity of Catania
 
Web or SDK Development
Web or SDK DevelopmentWeb or SDK Development
Web or SDK DevelopmentJohn Wilker
 
Afik Gal @alphageeks: Flex Intro
Afik Gal @alphageeks: Flex IntroAfik Gal @alphageeks: Flex Intro
Afik Gal @alphageeks: Flex IntroAlphageeks
 
JMP208 The Never Ending Integration Story: How to Integrate Your Lotus Notes,...
JMP208 The Never Ending Integration Story: How to Integrate Your Lotus Notes,...JMP208 The Never Ending Integration Story: How to Integrate Your Lotus Notes,...
JMP208 The Never Ending Integration Story: How to Integrate Your Lotus Notes,...John Head
 
Lotusphere 2011 - Jmp208
Lotusphere 2011 - Jmp208Lotusphere 2011 - Jmp208
Lotusphere 2011 - Jmp208akassabov
 

Similar to Functional webapplicaations using fsharp and suave (20)

Expo - Zero to App.pptx
Expo - Zero to App.pptxExpo - Zero to App.pptx
Expo - Zero to App.pptx
 
Building Better Web Apps with F#
Building Better Web Apps with F#Building Better Web Apps with F#
Building Better Web Apps with F#
 
Developing FirefoxOS
Developing FirefoxOSDeveloping FirefoxOS
Developing FirefoxOS
 
Bay NET Aug 19 2009 presentation ppt
Bay  NET Aug 19 2009 presentation pptBay  NET Aug 19 2009 presentation ppt
Bay NET Aug 19 2009 presentation ppt
 
Building Better Web Apps with F#
Building Better Web Apps with F#Building Better Web Apps with F#
Building Better Web Apps with F#
 
Videogram - Building a product with Sencha Touch
Videogram - Building a product with Sencha TouchVideogram - Building a product with Sencha Touch
Videogram - Building a product with Sencha Touch
 
Top 11 Front-End Web Development Tools To Consider in 2020
 Top 11 Front-End Web Development Tools To Consider in 2020 Top 11 Front-End Web Development Tools To Consider in 2020
Top 11 Front-End Web Development Tools To Consider in 2020
 
Building windows phone_apps_-_a_developers_guide_v7_no_cover
Building windows phone_apps_-_a_developers_guide_v7_no_coverBuilding windows phone_apps_-_a_developers_guide_v7_no_cover
Building windows phone_apps_-_a_developers_guide_v7_no_cover
 
Domain Modeling & Full-Stack Web Development F#
Domain Modeling & Full-Stack Web Development F#Domain Modeling & Full-Stack Web Development F#
Domain Modeling & Full-Stack Web Development F#
 
Lightning In The Clouds
Lightning In The CloudsLightning In The Clouds
Lightning In The Clouds
 
What is Codename One - Transcript.pdf
What is Codename One - Transcript.pdfWhat is Codename One - Transcript.pdf
What is Codename One - Transcript.pdf
 
LAP II - Lezione 01 Introduzione al corso
LAP II - Lezione 01   Introduzione al corsoLAP II - Lezione 01   Introduzione al corso
LAP II - Lezione 01 Introduzione al corso
 
Web or SDK Development
Web or SDK DevelopmentWeb or SDK Development
Web or SDK Development
 
test4
test4test4
test4
 
Web
WebWeb
Web
 
test4
test4test4
test4
 
test3
test3test3
test3
 
Afik Gal @alphageeks: Flex Intro
Afik Gal @alphageeks: Flex IntroAfik Gal @alphageeks: Flex Intro
Afik Gal @alphageeks: Flex Intro
 
JMP208 The Never Ending Integration Story: How to Integrate Your Lotus Notes,...
JMP208 The Never Ending Integration Story: How to Integrate Your Lotus Notes,...JMP208 The Never Ending Integration Story: How to Integrate Your Lotus Notes,...
JMP208 The Never Ending Integration Story: How to Integrate Your Lotus Notes,...
 
Lotusphere 2011 - Jmp208
Lotusphere 2011 - Jmp208Lotusphere 2011 - Jmp208
Lotusphere 2011 - Jmp208
 

More from Tomas Jansson

F# as our day job by 2016
F# as our day job by 2016F# as our day job by 2016
F# as our day job by 2016Tomas Jansson
 
What does the future hold for us in asp.net 5
What does the future hold for us in asp.net 5What does the future hold for us in asp.net 5
What does the future hold for us in asp.net 5Tomas Jansson
 
OWIN Web API with Linky
OWIN Web API with LinkyOWIN Web API with Linky
OWIN Web API with LinkyTomas Jansson
 
File -> new project to deploy in 10 minutes with TeamCity and Octopus Deploy
File -> new project to deploy in 10 minutes with TeamCity and Octopus DeployFile -> new project to deploy in 10 minutes with TeamCity and Octopus Deploy
File -> new project to deploy in 10 minutes with TeamCity and Octopus DeployTomas Jansson
 
Getting started with Elasticsearch and .NET
Getting started with Elasticsearch and .NETGetting started with Elasticsearch and .NET
Getting started with Elasticsearch and .NETTomas Jansson
 
Deployment taken seriously with Octopus Deploy and TeamCity
Deployment taken seriously with Octopus Deploy and TeamCityDeployment taken seriously with Octopus Deploy and TeamCity
Deployment taken seriously with Octopus Deploy and TeamCityTomas Jansson
 
NServiceBus workshop presentation
NServiceBus workshop presentationNServiceBus workshop presentation
NServiceBus workshop presentationTomas Jansson
 
SignalR - Building an async web app with .NET
SignalR - Building an async web app with .NETSignalR - Building an async web app with .NET
SignalR - Building an async web app with .NETTomas Jansson
 
REST for .NET - Introduction to ASP.NET Web API
REST for .NET - Introduction to ASP.NET Web APIREST for .NET - Introduction to ASP.NET Web API
REST for .NET - Introduction to ASP.NET Web APITomas Jansson
 

More from Tomas Jansson (12)

F# as our day job by 2016
F# as our day job by 2016F# as our day job by 2016
F# as our day job by 2016
 
What does the future hold for us in asp.net 5
What does the future hold for us in asp.net 5What does the future hold for us in asp.net 5
What does the future hold for us in asp.net 5
 
Polyglot heaven
Polyglot heavenPolyglot heaven
Polyglot heaven
 
OWIN Web API with Linky
OWIN Web API with LinkyOWIN Web API with Linky
OWIN Web API with Linky
 
Roslyn
RoslynRoslyn
Roslyn
 
File -> new project to deploy in 10 minutes with TeamCity and Octopus Deploy
File -> new project to deploy in 10 minutes with TeamCity and Octopus DeployFile -> new project to deploy in 10 minutes with TeamCity and Octopus Deploy
File -> new project to deploy in 10 minutes with TeamCity and Octopus Deploy
 
Getting started with Elasticsearch and .NET
Getting started with Elasticsearch and .NETGetting started with Elasticsearch and .NET
Getting started with Elasticsearch and .NET
 
Deployment taken seriously with Octopus Deploy and TeamCity
Deployment taken seriously with Octopus Deploy and TeamCityDeployment taken seriously with Octopus Deploy and TeamCity
Deployment taken seriously with Octopus Deploy and TeamCity
 
State or intent
State or intentState or intent
State or intent
 
NServiceBus workshop presentation
NServiceBus workshop presentationNServiceBus workshop presentation
NServiceBus workshop presentation
 
SignalR - Building an async web app with .NET
SignalR - Building an async web app with .NETSignalR - Building an async web app with .NET
SignalR - Building an async web app with .NET
 
REST for .NET - Introduction to ASP.NET Web API
REST for .NET - Introduction to ASP.NET Web APIREST for .NET - Introduction to ASP.NET Web API
REST for .NET - Introduction to ASP.NET Web API
 

Recently uploaded

定制(Waikato毕业证书)新西兰怀卡托大学毕业证成绩单原版一比一
定制(Waikato毕业证书)新西兰怀卡托大学毕业证成绩单原版一比一定制(Waikato毕业证书)新西兰怀卡托大学毕业证成绩单原版一比一
定制(Waikato毕业证书)新西兰怀卡托大学毕业证成绩单原版一比一Fs
 
Storytelling, Ethics and Workflow in Documentary Photography
Storytelling, Ethics and Workflow in Documentary PhotographyStorytelling, Ethics and Workflow in Documentary Photography
Storytelling, Ethics and Workflow in Documentary PhotographyOrtega Alikwe
 
Gurgaon Call Girls: Free Delivery 24x7 at Your Doorstep G.G.N = 8377087607
Gurgaon Call Girls: Free Delivery 24x7 at Your Doorstep G.G.N = 8377087607Gurgaon Call Girls: Free Delivery 24x7 at Your Doorstep G.G.N = 8377087607
Gurgaon Call Girls: Free Delivery 24x7 at Your Doorstep G.G.N = 8377087607dollysharma2066
 
Application deck- Cyril Caudroy-2024.pdf
Application deck- Cyril Caudroy-2024.pdfApplication deck- Cyril Caudroy-2024.pdf
Application deck- Cyril Caudroy-2024.pdfCyril CAUDROY
 
Ioannis Tzachristas Self-Presentation for MBA.pdf
Ioannis Tzachristas Self-Presentation for MBA.pdfIoannis Tzachristas Self-Presentation for MBA.pdf
Ioannis Tzachristas Self-Presentation for MBA.pdfjtzach
 
定制(UQ毕业证书)澳洲昆士兰大学毕业证成绩单原版一比一
定制(UQ毕业证书)澳洲昆士兰大学毕业证成绩单原版一比一定制(UQ毕业证书)澳洲昆士兰大学毕业证成绩单原版一比一
定制(UQ毕业证书)澳洲昆士兰大学毕业证成绩单原版一比一lvtagr7
 
原版定制copy澳洲查尔斯达尔文大学毕业证CDU毕业证成绩单留信学历认证保障质量
原版定制copy澳洲查尔斯达尔文大学毕业证CDU毕业证成绩单留信学历认证保障质量原版定制copy澳洲查尔斯达尔文大学毕业证CDU毕业证成绩单留信学历认证保障质量
原版定制copy澳洲查尔斯达尔文大学毕业证CDU毕业证成绩单留信学历认证保障质量sehgh15heh
 
Drawing animals and props.pptxDrawing animals and props.pptxDrawing animals a...
Drawing animals and props.pptxDrawing animals and props.pptxDrawing animals a...Drawing animals and props.pptxDrawing animals and props.pptxDrawing animals a...
Drawing animals and props.pptxDrawing animals and props.pptxDrawing animals a...RegineManuel2
 
Unlock Your Creative Potential: 7 Skills for Content Creator Evolution
Unlock Your Creative Potential: 7 Skills for Content Creator EvolutionUnlock Your Creative Potential: 7 Skills for Content Creator Evolution
Unlock Your Creative Potential: 7 Skills for Content Creator EvolutionRhazes Ghaisan
 
ME 205- Chapter 6 - Pure Bending of Beams.pdf
ME 205- Chapter 6 - Pure Bending of Beams.pdfME 205- Chapter 6 - Pure Bending of Beams.pdf
ME 205- Chapter 6 - Pure Bending of Beams.pdfaae4149584
 
办理学位证(纽伦堡大学文凭证书)纽伦堡大学毕业证成绩单原版一模一样
办理学位证(纽伦堡大学文凭证书)纽伦堡大学毕业证成绩单原版一模一样办理学位证(纽伦堡大学文凭证书)纽伦堡大学毕业证成绩单原版一模一样
办理学位证(纽伦堡大学文凭证书)纽伦堡大学毕业证成绩单原版一模一样umasea
 
Escort Service Andheri WhatsApp:+91-9833363713
Escort Service Andheri WhatsApp:+91-9833363713Escort Service Andheri WhatsApp:+91-9833363713
Escort Service Andheri WhatsApp:+91-9833363713Riya Pathan
 
AICTE PPT slide of Engineering college kr pete
AICTE PPT slide of Engineering college kr peteAICTE PPT slide of Engineering college kr pete
AICTE PPT slide of Engineering college kr peteshivubhavv
 
LinkedIn Strategic Guidelines April 2024
LinkedIn Strategic Guidelines April 2024LinkedIn Strategic Guidelines April 2024
LinkedIn Strategic Guidelines April 2024Bruce Bennett
 
办理(Salford毕业证书)索尔福德大学毕业证成绩单原版一比一
办理(Salford毕业证书)索尔福德大学毕业证成绩单原版一比一办理(Salford毕业证书)索尔福德大学毕业证成绩单原版一比一
办理(Salford毕业证书)索尔福德大学毕业证成绩单原版一比一diploma 1
 
办理学位证(Massey证书)新西兰梅西大学毕业证成绩单原版一比一
办理学位证(Massey证书)新西兰梅西大学毕业证成绩单原版一比一办理学位证(Massey证书)新西兰梅西大学毕业证成绩单原版一比一
办理学位证(Massey证书)新西兰梅西大学毕业证成绩单原版一比一A SSS
 
办澳洲詹姆斯库克大学毕业证成绩单pdf电子版制作修改
办澳洲詹姆斯库克大学毕业证成绩单pdf电子版制作修改办澳洲詹姆斯库克大学毕业证成绩单pdf电子版制作修改
办澳洲詹姆斯库克大学毕业证成绩单pdf电子版制作修改yuu sss
 
Crack JAG. Guidance program for entry to JAG Dept. & SSB interview
Crack JAG. Guidance program for entry to JAG Dept. & SSB interviewCrack JAG. Guidance program for entry to JAG Dept. & SSB interview
Crack JAG. Guidance program for entry to JAG Dept. & SSB interviewNilendra Kumar
 

Recently uploaded (20)

Young Call~Girl in Pragati Maidan New Delhi 8448380779 Full Enjoy Escort Service
Young Call~Girl in Pragati Maidan New Delhi 8448380779 Full Enjoy Escort ServiceYoung Call~Girl in Pragati Maidan New Delhi 8448380779 Full Enjoy Escort Service
Young Call~Girl in Pragati Maidan New Delhi 8448380779 Full Enjoy Escort Service
 
定制(Waikato毕业证书)新西兰怀卡托大学毕业证成绩单原版一比一
定制(Waikato毕业证书)新西兰怀卡托大学毕业证成绩单原版一比一定制(Waikato毕业证书)新西兰怀卡托大学毕业证成绩单原版一比一
定制(Waikato毕业证书)新西兰怀卡托大学毕业证成绩单原版一比一
 
Storytelling, Ethics and Workflow in Documentary Photography
Storytelling, Ethics and Workflow in Documentary PhotographyStorytelling, Ethics and Workflow in Documentary Photography
Storytelling, Ethics and Workflow in Documentary Photography
 
FULL ENJOY Call Girls In Gautam Nagar (Delhi) Call Us 9953056974
FULL ENJOY Call Girls In Gautam Nagar (Delhi) Call Us 9953056974FULL ENJOY Call Girls In Gautam Nagar (Delhi) Call Us 9953056974
FULL ENJOY Call Girls In Gautam Nagar (Delhi) Call Us 9953056974
 
Gurgaon Call Girls: Free Delivery 24x7 at Your Doorstep G.G.N = 8377087607
Gurgaon Call Girls: Free Delivery 24x7 at Your Doorstep G.G.N = 8377087607Gurgaon Call Girls: Free Delivery 24x7 at Your Doorstep G.G.N = 8377087607
Gurgaon Call Girls: Free Delivery 24x7 at Your Doorstep G.G.N = 8377087607
 
Application deck- Cyril Caudroy-2024.pdf
Application deck- Cyril Caudroy-2024.pdfApplication deck- Cyril Caudroy-2024.pdf
Application deck- Cyril Caudroy-2024.pdf
 
Ioannis Tzachristas Self-Presentation for MBA.pdf
Ioannis Tzachristas Self-Presentation for MBA.pdfIoannis Tzachristas Self-Presentation for MBA.pdf
Ioannis Tzachristas Self-Presentation for MBA.pdf
 
定制(UQ毕业证书)澳洲昆士兰大学毕业证成绩单原版一比一
定制(UQ毕业证书)澳洲昆士兰大学毕业证成绩单原版一比一定制(UQ毕业证书)澳洲昆士兰大学毕业证成绩单原版一比一
定制(UQ毕业证书)澳洲昆士兰大学毕业证成绩单原版一比一
 
原版定制copy澳洲查尔斯达尔文大学毕业证CDU毕业证成绩单留信学历认证保障质量
原版定制copy澳洲查尔斯达尔文大学毕业证CDU毕业证成绩单留信学历认证保障质量原版定制copy澳洲查尔斯达尔文大学毕业证CDU毕业证成绩单留信学历认证保障质量
原版定制copy澳洲查尔斯达尔文大学毕业证CDU毕业证成绩单留信学历认证保障质量
 
Drawing animals and props.pptxDrawing animals and props.pptxDrawing animals a...
Drawing animals and props.pptxDrawing animals and props.pptxDrawing animals a...Drawing animals and props.pptxDrawing animals and props.pptxDrawing animals a...
Drawing animals and props.pptxDrawing animals and props.pptxDrawing animals a...
 
Unlock Your Creative Potential: 7 Skills for Content Creator Evolution
Unlock Your Creative Potential: 7 Skills for Content Creator EvolutionUnlock Your Creative Potential: 7 Skills for Content Creator Evolution
Unlock Your Creative Potential: 7 Skills for Content Creator Evolution
 
ME 205- Chapter 6 - Pure Bending of Beams.pdf
ME 205- Chapter 6 - Pure Bending of Beams.pdfME 205- Chapter 6 - Pure Bending of Beams.pdf
ME 205- Chapter 6 - Pure Bending of Beams.pdf
 
办理学位证(纽伦堡大学文凭证书)纽伦堡大学毕业证成绩单原版一模一样
办理学位证(纽伦堡大学文凭证书)纽伦堡大学毕业证成绩单原版一模一样办理学位证(纽伦堡大学文凭证书)纽伦堡大学毕业证成绩单原版一模一样
办理学位证(纽伦堡大学文凭证书)纽伦堡大学毕业证成绩单原版一模一样
 
Escort Service Andheri WhatsApp:+91-9833363713
Escort Service Andheri WhatsApp:+91-9833363713Escort Service Andheri WhatsApp:+91-9833363713
Escort Service Andheri WhatsApp:+91-9833363713
 
AICTE PPT slide of Engineering college kr pete
AICTE PPT slide of Engineering college kr peteAICTE PPT slide of Engineering college kr pete
AICTE PPT slide of Engineering college kr pete
 
LinkedIn Strategic Guidelines April 2024
LinkedIn Strategic Guidelines April 2024LinkedIn Strategic Guidelines April 2024
LinkedIn Strategic Guidelines April 2024
 
办理(Salford毕业证书)索尔福德大学毕业证成绩单原版一比一
办理(Salford毕业证书)索尔福德大学毕业证成绩单原版一比一办理(Salford毕业证书)索尔福德大学毕业证成绩单原版一比一
办理(Salford毕业证书)索尔福德大学毕业证成绩单原版一比一
 
办理学位证(Massey证书)新西兰梅西大学毕业证成绩单原版一比一
办理学位证(Massey证书)新西兰梅西大学毕业证成绩单原版一比一办理学位证(Massey证书)新西兰梅西大学毕业证成绩单原版一比一
办理学位证(Massey证书)新西兰梅西大学毕业证成绩单原版一比一
 
办澳洲詹姆斯库克大学毕业证成绩单pdf电子版制作修改
办澳洲詹姆斯库克大学毕业证成绩单pdf电子版制作修改办澳洲詹姆斯库克大学毕业证成绩单pdf电子版制作修改
办澳洲詹姆斯库克大学毕业证成绩单pdf电子版制作修改
 
Crack JAG. Guidance program for entry to JAG Dept. & SSB interview
Crack JAG. Guidance program for entry to JAG Dept. & SSB interviewCrack JAG. Guidance program for entry to JAG Dept. & SSB interview
Crack JAG. Guidance program for entry to JAG Dept. & SSB interview
 

Functional webapplicaations using fsharp and suave

Editor's Notes

  1. Good morning everyone and welcome to this talk about functional programming and web applications. Web applications in the context of this talk is server side web applications, or web apis. You can implement client side applications using a F# project call Fable if you want to, but that is not in scope for this talk. Before I go any further I would like to know a little bit more about you. How many know F#? How many here have used Suave?
  2. Let me introduce myself. My name is Tomas Jansson and I work as a manager at Bekk Consulting here in Oslo, where I am the practice lead of .NET. Even though my title is manager, it is just a label, I am a developer like most of you I guess and that is what I do most of the time. The customer I work for is in the public sector and we have brought in F# in some of our solutions there. I hope to see a wider adoption in the long run, but it is a long walk a head of us to get there. When I’m not working and not relaxing at home I’m also engaged in the community. I lead the NNUG Group here in Oslo and is also the initator of OsloFSharp which is a subgroup of NNUG for practical reasons which we started about this time last year and already have more than 200 members already. I am a Microsoft MVP and F# enthusiast.
  3. What is F# and why should you care? Let’s first answer the what part, since that is more concrete and nothing you can argue It started of at Microsoft Research but it is fully open source and it is now the FSharp Foundation that maintains the open-source code repository. F# is a functional first language with it roots in the ML tree of languages that runs on the .NET platforms. That means it runs on both the CLR on Windows and Mono on linux systems. There is work going on to get F# to run on dotnetcore and you can try that out today if you want to. That was what F# is, but why do I like F# and why should you consider it?
  4. Strong typing  if it compiles it most likely runs Not null  Tony Hoare, who introduced it in algol in the year of 65 I think, called it his billion dollar mistake. It is hard to reason and deal with null, so just not having it is easer. Take a list structure in C#, what does it mean when the list is null? Is it empty or did an error occur. That’s really hard to know without looking through the implementation details. Immutability by default  when things are immutable it is much easier to reason of what the state of something is since nothing can change the state. Every time you need to change something that is immutable you create a new copy instead, It’s not as expensive at it sounds and the syntax support for it makes it as easy as setting a property in C#. Structural equality  this just make sense. When comparing things you actually check what the values are instead of checking by reference which is the default in C#. No matter what you compare in F# it works the same way. This is as long as you use types defined in F# and not doing weird things.
  5. Composability is one of the most important concepts in F#. Can compose types and functions in an easy manner. Making it easy to from this to…
  6. This. Terrifying deathstar You can compose things in most languages, but the question is how easy it is to do so and how much noise it introduces. The syntax of F# makes it really easy to compose types from other types, without any boiler plate, it also makes it really easy to write functions and combine functions to form a whole in an easy manner. We will see some of this in the demo later on.
  7. Feedback in many levels - Amazing eco-system with a lot of open source projects and active community. This is probably one of the things I like the most with F#. Everyone in the community is super smart and really helpful. - The next level of feedback is when you code and use the REPL. The REPL makes really easy to do some fast prototyping and experiments before turning the code into a library, if you wish. - Feedback also comes in the form of testing. I would say that the way you write functional code tend to make it much easier to test, since that is what you do constantly in the the REPL. Converting things you wrote in the REPL to a test for more feedback in the long run is really easy as well.
  8. But F# and web? #wat?
  9. I would go as far as to say that all applications are functions! And since web applications are applications they are also functions. What do I mean?
  10. Most people thing of a web applications like this. You have some kind of client that makes a request to the server and get a response back. This is only a mental model.
  11. But what if you just change the arrows as a first attempt to change your mental model of a web application.
  12. When you have done the first step it’s not hard to see that this is exactly what a function is. This brings us to the last part of me just talking and that is.
  13. It will also run on dotnetcore when all the F#-bits are ready. There is already some bits running on dotnetcore, but I haven’t tried it yet. I have tried it on mono and Windows and the programming experience using Suave hits a sweet spot for me at least. You get a lot of control, and at the same time it is really easy to get started. It is implemented in F# for F# to be a idiomatic functional web framework, compared with for example asp.net which you also can use together with F# if you want to.
  14. The three most imporntat concepts in Suave according to me are these three. And I will go into a little bit more detail before showing them in practice.
  15. The context is what holds all the request and response data through a web request. Each request basically starts with a default context and then you create new contexts, remember that F# is immutable, through a series of steps.
  16. Those steps are WebParts.
  17. The signature of a webpart looks like this. Which basically reads, take a HttpContext as input, return a async computation that returns either Some of a new HttpContext or None if this WebPart should be skipped.
  18. This is the glue that glues web parts together.
  19. This is the glue that glues web parts together.
  20. This is how it is defined bottom up. You start with a set of functions or values, it could be a function that looks something up in a database, a function that renders html, or something that modifies a header value, ot it could even be a ready WebPart.
  21. The next step is to apply a combinator to create a WebPart, if you have a function that returns a json object you might use a combinator to create the actual httpcontext from that object.
  22. If you have multiple endpoints you usually use another combinator to wrap the webparts to create a single webpart. If you then have cross-cutting concerns you migh have additional layers that wrap the last webpart. That is the simplified version of how it works, and that’s basically all there is to it.
  23. I will be using these two tools as well. Paket for handling packages, which is a package manager for nuget packages FAKE is a build automation system. I won’t go into details about how this two tools work, but please come ask questions afterwards if you have question regarding these two tools. But they are worth looking into even for C# devs.
  24. Great stricter but yet more flexible language than C# Runs great on all common platforms through clr and mono
  25. The web is functional, and programming web applications in a functional language can be a new amazing experience where you can combine and put together applications the same way you build lego.
  26. A great option if you want to program the web in a functional language is F# with Suave.