Functional webapplicaations using fsharp and suave
-
Upload
tomas-jansson -
Category
Career
-
view
1.281 -
download
0
Transcript of Functional webapplicaations using fsharp and suave
![Page 1: Functional webapplicaations using fsharp and suave](https://reader036.fdocuments.in/reader036/viewer/2022062503/5879b92c1a28ab6b2c8b7597/html5/thumbnails/1.jpg)
FunctionalWeb Applicationsusing
F# and Suave
@TomasJansson
![Page 2: Functional webapplicaations using fsharp and suave](https://reader036.fdocuments.in/reader036/viewer/2022062503/5879b92c1a28ab6b2c8b7597/html5/thumbnails/2.jpg)
BEKKDeveloperPractice lead .NET
OsloFSharp/NNUGMicrosoft MVPF# enthusiast
![Page 3: Functional webapplicaations using fsharp and suave](https://reader036.fdocuments.in/reader036/viewer/2022062503/5879b92c1a28ab6b2c8b7597/html5/thumbnails/3.jpg)
F#?
![Page 4: Functional webapplicaations using fsharp and suave](https://reader036.fdocuments.in/reader036/viewer/2022062503/5879b92c1a28ab6b2c8b7597/html5/thumbnails/4.jpg)
Flickr: Supportive / Scott Robinson/ Creative Commons
Solid foundation
![Page 5: Functional webapplicaations using fsharp and suave](https://reader036.fdocuments.in/reader036/viewer/2022062503/5879b92c1a28ab6b2c8b7597/html5/thumbnails/5.jpg)
Flickr: Lego Bricks/ Benjamin Esham / Creative Commons
Composability
![Page 6: Functional webapplicaations using fsharp and suave](https://reader036.fdocuments.in/reader036/viewer/2022062503/5879b92c1a28ab6b2c8b7597/html5/thumbnails/6.jpg)
Flickr: Lego Set 10143 Death Star Todesstern / Dude of Lego/ Creative Commons
Composability
![Page 7: Functional webapplicaations using fsharp and suave](https://reader036.fdocuments.in/reader036/viewer/2022062503/5879b92c1a28ab6b2c8b7597/html5/thumbnails/7.jpg)
Feedback
![Page 8: Functional webapplicaations using fsharp and suave](https://reader036.fdocuments.in/reader036/viewer/2022062503/5879b92c1a28ab6b2c8b7597/html5/thumbnails/8.jpg)
Why F# and Web?
![Page 9: Functional webapplicaations using fsharp and suave](https://reader036.fdocuments.in/reader036/viewer/2022062503/5879b92c1a28ab6b2c8b7597/html5/thumbnails/9.jpg)
All applications are functions,also web applications
![Page 10: Functional webapplicaations using fsharp and suave](https://reader036.fdocuments.in/reader036/viewer/2022062503/5879b92c1a28ab6b2c8b7597/html5/thumbnails/10.jpg)
Server
Request
Response
![Page 11: Functional webapplicaations using fsharp and suave](https://reader036.fdocuments.in/reader036/viewer/2022062503/5879b92c1a28ab6b2c8b7597/html5/thumbnails/11.jpg)
ServerRequest Response
![Page 12: Functional webapplicaations using fsharp and suave](https://reader036.fdocuments.in/reader036/viewer/2022062503/5879b92c1a28ab6b2c8b7597/html5/thumbnails/12.jpg)
FunctionInput Output
![Page 13: Functional webapplicaations using fsharp and suave](https://reader036.fdocuments.in/reader036/viewer/2022062503/5879b92c1a28ab6b2c8b7597/html5/thumbnails/13.jpg)
?
![Page 14: Functional webapplicaations using fsharp and suave](https://reader036.fdocuments.in/reader036/viewer/2022062503/5879b92c1a28ab6b2c8b7597/html5/thumbnails/14.jpg)
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/
![Page 15: Functional webapplicaations using fsharp and suave](https://reader036.fdocuments.in/reader036/viewer/2022062503/5879b92c1a28ab6b2c8b7597/html5/thumbnails/15.jpg)
HttpContextWebPartCombinators
![Page 16: Functional webapplicaations using fsharp and suave](https://reader036.fdocuments.in/reader036/viewer/2022062503/5879b92c1a28ab6b2c8b7597/html5/thumbnails/16.jpg)
HttpContext
![Page 17: Functional webapplicaations using fsharp and suave](https://reader036.fdocuments.in/reader036/viewer/2022062503/5879b92c1a28ab6b2c8b7597/html5/thumbnails/17.jpg)
WebPart
![Page 18: Functional webapplicaations using fsharp and suave](https://reader036.fdocuments.in/reader036/viewer/2022062503/5879b92c1a28ab6b2c8b7597/html5/thumbnails/18.jpg)
WebPart
![Page 19: Functional webapplicaations using fsharp and suave](https://reader036.fdocuments.in/reader036/viewer/2022062503/5879b92c1a28ab6b2c8b7597/html5/thumbnails/19.jpg)
Combinators
![Page 20: Functional webapplicaations using fsharp and suave](https://reader036.fdocuments.in/reader036/viewer/2022062503/5879b92c1a28ab6b2c8b7597/html5/thumbnails/20.jpg)
Combinators… that create a WebPart from more primitive values
… that combine multiple WebParts to a single WebPart
![Page 21: Functional webapplicaations using fsharp and suave](https://reader036.fdocuments.in/reader036/viewer/2022062503/5879b92c1a28ab6b2c8b7597/html5/thumbnails/21.jpg)
Model (simplified)
fun funfun
1. Start with some functions or values
![Page 22: Functional webapplicaations using fsharp and suave](https://reader036.fdocuments.in/reader036/viewer/2022062503/5879b92c1a28ab6b2c8b7597/html5/thumbnails/22.jpg)
WebPartWebPartWebPart
Model (simplified)
fun funfun
1. Start with some functions or values2. Apply one or more combinator to each function or value to create some WebParts
![Page 23: Functional webapplicaations using fsharp and suave](https://reader036.fdocuments.in/reader036/viewer/2022062503/5879b92c1a28ab6b2c8b7597/html5/thumbnails/23.jpg)
WebPart
Model (simplified)1. Start with some functions or values2. Apply one or more combinator to each function or value to create some WebParts3. Apply a combinator to the WebParts to create a single WebPart (repeat if needed)
WebPartWebPartWebPart
fun funfun
![Page 24: Functional webapplicaations using fsharp and suave](https://reader036.fdocuments.in/reader036/viewer/2022062503/5879b92c1a28ab6b2c8b7597/html5/thumbnails/24.jpg)
Demo
![Page 25: Functional webapplicaations using fsharp and suave](https://reader036.fdocuments.in/reader036/viewer/2022062503/5879b92c1a28ab6b2c8b7597/html5/thumbnails/25.jpg)
Demo
http://fsharp.github.io/FAKE/ http://fsprojects.github.io/Paket/
Paket FAKE
![Page 26: Functional webapplicaations using fsharp and suave](https://reader036.fdocuments.in/reader036/viewer/2022062503/5879b92c1a28ab6b2c8b7597/html5/thumbnails/26.jpg)
Summary
![Page 27: Functional webapplicaations using fsharp and suave](https://reader036.fdocuments.in/reader036/viewer/2022062503/5879b92c1a28ab6b2c8b7597/html5/thumbnails/27.jpg)
F# is awesome
![Page 28: Functional webapplicaations using fsharp and suave](https://reader036.fdocuments.in/reader036/viewer/2022062503/5879b92c1a28ab6b2c8b7597/html5/thumbnails/28.jpg)
F# is awesomeThe web is functional
![Page 29: Functional webapplicaations using fsharp and suave](https://reader036.fdocuments.in/reader036/viewer/2022062503/5879b92c1a28ab6b2c8b7597/html5/thumbnails/29.jpg)
F# is awesomeThe web is functionalProgram the web using Suave
![Page 30: Functional webapplicaations using fsharp and suave](https://reader036.fdocuments.in/reader036/viewer/2022062503/5879b92c1a28ab6b2c8b7597/html5/thumbnails/30.jpg)
Resourceshttps://suave.io/
https://github.com/SuaveIO/suave
https://www.gitbook.com/book/theimowski/suave-music-store/
https://github.com/mastoj/my-share
![Page 31: Functional webapplicaations using fsharp and suave](https://reader036.fdocuments.in/reader036/viewer/2022062503/5879b92c1a28ab6b2c8b7597/html5/thumbnails/31.jpg)
![Page 32: Functional webapplicaations using fsharp and suave](https://reader036.fdocuments.in/reader036/viewer/2022062503/5879b92c1a28ab6b2c8b7597/html5/thumbnails/32.jpg)
FP Lab HourRoom 10 at
13:40
![Page 33: Functional webapplicaations using fsharp and suave](https://reader036.fdocuments.in/reader036/viewer/2022062503/5879b92c1a28ab6b2c8b7597/html5/thumbnails/33.jpg)
?
![Page 34: Functional webapplicaations using fsharp and suave](https://reader036.fdocuments.in/reader036/viewer/2022062503/5879b92c1a28ab6b2c8b7597/html5/thumbnails/34.jpg)
@TomasJanssongithub.com/mastojslideshare.net/mastoj