Refactor function returning an IO (Either String _) to use MonadError instead #57

Open
opened 2020-07-07 23:48:46 +02:00 by schmittlauch · 0 comments
Owner

Most functions doing network lookups return an IO (Either String ActuallyWantedType) to indicate the possibility and cause of an error.

For better composability, these could be refactored to use MonadError String, MonadIO instead. Then several of these actions can be composed, fail using throwError and then expose this error only through catchError or runExceptT.

Most functions doing network lookups return an `IO (Either String ActuallyWantedType)` to indicate the possibility and cause of an error. For better composability, these could be refactored to use `MonadError String, MonadIO` instead. Then several of these actions can be composed, fail using `throwError` and then expose this error only through `catchError` or `runExceptT`.
schmittlauch added the
refactoring
label 2020-07-07 23:48:46 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: schmittlauch/Hash2Pub#57
No description provided.