liveBook · Manning

Servant server

As explained in Learn Haskell by Example

A Servant Server is a collection of endpoint handlers implementing the complete specification of an API.

A Servant server combines endpoint handlers into the implementation of a complete API specification. Each handler returns a Servant Handler action, while database operations can be supplied as IO actions. section 17.1.3

Todo API server

mkTodoApiServer takes a database Connection, specializes database actions such as getEntries and addEntry, and combines entriesHandler, addHandler, and toggleHandler into a Server TodoApi.

How Learn Haskell by Example covers it

How deep it goes
Explains handler construction, IO lifting, error responses, and composition, stopping short of server deployment.
Examples
Uses Todo API handlers for listing entries, adding entries, and toggling an entry.
What you can do after
Build it from scratch by wiring database-backed handlers into a typed Servant server.
How it connects
Connects Handler, IO, database connections, ServerError, and API types.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Learn Haskell by Example. The section links point to the parts of the book it draws on.