about summary refs log tree commit diff
path: root/scratch
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2020-08-10T14·02+0100
committerWilliam Carroll <wpcarro@gmail.com>2020-08-10T14·02+0100
commit4ff1ea291c266c68acfd662b7439d5c2061907ea (patch)
treeb019dcc69bbf4964b1964650f1f4e66bbed49cac /scratch
parentf61ed25755da89f6068efb75642e2ac22d268278 (diff)
Drop support for ServantT transformer type for server
After burning a few hours wrestling with the type system, I decided to revert to
the simpler `Server API` type instead of the `ServantT` transformer type.

The problem is that I couldn't write a MonadError instance for `RIO Context`,
which is my `AppM` (i.e. application monad). Using `throwIO` in the server
handlers results in 500 errors, which is not what I wanted. I'm still pretty
fuzzy about what's happening; I now know that exception handling in Haskell is
pretty gnaryly. I may revisit this at a later time when my knowledge is more
extensive. For now: time to fry bigger fish.

An easier abstract is for me to pass `T.Context` into `server` as an argument,
which after all is what a Reader does.

TL;DR:
- Read server, client ports from .envrc
- Define a top-level Failure type (empty for now)
- Define a top-level Success type
- Define App as RIO Context (Either Failure Success)
Diffstat (limited to 'scratch')
0 files changed, 0 insertions, 0 deletions