Refactor function returning an IO (Either String _)
to use MonadError instead #57
Labels
No labels
ActivityPub
advanced features
basic functionality
bug
DHT
evaluation
refactoring
security
test case
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: schmittlauch/Hash2Pub#57
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 usingthrowError
and then expose this error only throughcatchError
orrunExceptT
.