functional webapplicaations using fsharp and suave
TRANSCRIPT
FunctionalWeb Applicationsusing
F# and Suave
@TomasJansson
BEKKDeveloperPractice lead .NET
OsloFSharp/NNUGMicrosoft MVPF# 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
ServerRequest Response
FunctionInput 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/
HttpContextWebPartCombinators
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 values2. Apply one or more combinator to each function or value to create some WebParts
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
Demo
Demo
http://fsharp.github.io/FAKE/ http://fsprojects.github.io/Paket/
Paket FAKE
Summary
F# is awesome
F# is awesomeThe web is functional
F# is awesomeThe web is functionalProgram the web using Suave
Resourceshttps://suave.io/
https://github.com/SuaveIO/suave
https://www.gitbook.com/book/theimowski/suave-music-store/
https://github.com/mastoj/my-share
FP Lab HourRoom 10 at
13:40
?
@TomasJanssongithub.com/mastojslideshare.net/mastoj