FP for Sceptics: ADTs in Practice
In previous post we defined ADTs as
Algebraic Data Types (or ADTs) model the flow of a program (or a system) in terms of data & functions that describe the complete behaviour and states the data can go through.
In this post, we will work through defining ADTs for an API service.
API service will return User's Information by:
- Extracting user id & password from the request
- Checks them against an authorization service
- Retrieves User's Information from database
- Returns User Information in response