Mailboxes, credit: Kristina Tripkovic

Overview

Continuing from our last blog, we will add a POST method to the API and consume it from React. We will keep track of the added comments by using the ReaderT monad.

The API type

Let’s extend the API type with a POST method :

Nothing remarkable, except maybe the NewComment type. Also, something new here is that we express that NewComment should be in the body of the request as…


Overview

Our last blog ended with a very simple REST server and a UI that could list comments, and that was it. Let’s expand it a bit with GET requests to fetch single comments!

GET resource in Servant

The GET request itself is reasonably close to what we already have. Let’s recall our current type :

We will add a second REST route first of all. Secondly, a GET request must specify one single comment it wants to retrieve so it needs some kind of unique id. …


Overview

In the first episode of our blogs we ended by having a working Haskell REST server serving our Servant WebApi type. The use case we are working towards is serving comments in a web app. A comment is currently just a string of text but we can expand on it in the future. In this part we will try to write a UI for it, exploring some React Admin specifics as we go.

React Admin — Overview

React Admin is a React framework that allows you to scaffold a CRUD web UI fast and easy as long as you stick to the defaults it…


Bridge between two large buildings
Bridge between two large buildings

Overview

I prefer using Haskell for my day-to-day programming challenges: the expressiveness and the type system make me a lot more productive. A typical project consists of a back-end and front-end part, and while Haskell has a clear track record for backend work, its application to frontend is far less common. There are of course front end frameworks in Haskell, but it is usually difficult to convince front end devs or designers to learn the shakespearean templating languages from Yesod for instance.

In practice, I use React with a backend REST server which allows me to write my server code in…

Kasper Janssens

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store