Lightning Talk: Build an ASP.NET Core Web App with F#? You must be having a Giraffe!

A presentation at F# eXchange 2019 in April 2019 in London, UK by Stuart Lang

Slide 1

Slide 1

Build an ASP.NET Core Web App with F#? You must be having a Giraffe!

Slide 2

Slide 2

What I’ll cover ◉ What is Giraffe ◉ Where does it fit in? ◉ How does it work? 2

Slide 3

Slide 3

1 What is it? 3

Slide 4

Slide 4

4 A functional ASP.NET Core micro web framework for building rich web applications. “

Slide 5

Slide 5

5

Slide 6

Slide 6

Idiomatic C# Idiomatic F# 6

Slide 7

Slide 7

An example Giraffe app (source) 7

Slide 8

Slide 8

1 How does it work? 8

Slide 9

Slide 9

Let’s model it! type HttpServer = 9

Slide 10

Slide 10

Let’s model it! type HttpHandler = 10

Slide 11

Slide 11

Let’s model it! 11

Slide 12

Slide 12

Let’s model it! type HttpHandler = 12

Slide 13

Slide 13

Let’s model it! (compose) 13

Slide 14

Slide 14

Let’s model it! 14

Slide 15

Slide 15

Let’s model it! type HttpHandler = 15

Slide 16

Slide 16

Let’s model it! But it could be better… https://medium.com/@gerardtoconnor/carry-on-continuation -over-binding-pipelines-for-functional-web-58bd7e6ea009 16

Slide 17

Slide 17

Let’s model it! type HttpFunc = type HttpHandler = 17

Slide 18

Slide 18

Let’s model it! Familiar… ASP.NET Core Middleware 18

Slide 19

Slide 19

Performance! 19

Slide 20

Slide 20

It’s a fullstack framework! ◉ View engines ○ DotLiquid ○ Razor ○ GiraffeViewEngine (HTML DSL) ◉ Much more 20

Slide 21

Slide 21

Resources ◉ Documentation ◉ Dustin Moris Gorski - Functional ASP.NET Core ◉ Zaid Ajaj Giraffe helpers 21

Slide 22

Slide 22

We use it! ◉ sse.co.uk 22

Slide 23

Slide 23

Summary ◉ Giraffe is great! ◉ We are spoilt for choice with web frameworks in F# 23

Slide 24

Slide 24

Thanks! ◉ Find me at: stu.dev 24