Skip to content
0:00 / 0:00

#wai#warp#haskell

Your First Haskell Web App With WAI And Warp by Michael Snoyman #FnConf19

ConfEngine

14K subscribers • 16 videos on Hallway

YouTube
  • Recommended by 1 person: 1 in engineering communities.
  • Presented by Michael Snoyman, creator of Yesod
  • May be out of date. Uploaded 6 years ago, in an area where tools change fast.

Beginner. No background in the topic needed.

13K views6 years ago1 recommendation

Web developmentProgramming languagesHaskellHTTP, REST and GraphQLWeb performance

Michael Snoyman demonstrates how to build a functioning web server from scratch using Haskell's WAI interface and Warp.

Haskell's Web Application Interface (WAI- pronounced ""why"") provides an abstraction between web applications and web servers. This allows many different web frameworks (e.g., Yesod, Spock, and Servant) to share servers like Warp and middlewares. Haskell's web frameworks offer a wide variety of feature sets, type-level and metaprogramming, and intended use cases. And for most use cases, I would recommend using an existing web framework, which will help you avoid common pitfalls and more quickly address common use cases. But not today! In this tutorial, we're going to step through building a functioning web server using just the bare-bones WAI interface and Warp as a server. Familiarity with the basics of Haskell will be a plus, but this will be a talk open to all FP and Haskell skill levels. More details: confengine.com/functional-conf-2019/proposal/12480 Conference Link: functionalconf.com

Why it's here

1 person recommends this

What people say. Engineers point to this tutorial to understand the core design and request-response flow of Haskell's WAI and Warp.

u/Faucelmein r/haskell • Recommends

Your First Haskell Web App With WAI And Warp

u/mistyharshin r/haskell • Mentions

Why does WAI provides a send/respond function when responding to an HTTP request? I am trying to understand WAI and warp web server. I am going through this video by Michael Snoyman where he explains the problem. Initially, he presents the core data types here in the video. The `Application` type should be: type Application = Request -> IO Response This feels intuitive but it **is not** especially when it streaming of the data using lazy bytes as explained here in the same video. And, then it concludes that the Application type is actually of: type Application = Request -> (Response -> IO ResponseReceived) -> IO ResponseReceived **What I don't understand is how lazy Byt…