What is the idiomatic way to handle the results from the database in a strongly typed functional language?
Author id: int, name: string, book_id: int
NewAuthor name: string, book_id: int
ViewAuthor name: string, book_title: string
Author represents the data in the db, NewAuthor allows for an insert operation, and ViewAuthor is for showing the data to a user.
You could argue for combing Author and NewAuthor and making id optional but I wanted to enforce at the type level that I was working with stored data without needing to check id everywhere.