New answers tagged

2

I think you did a pretty good job overall. You can simplify your code by making CounterService.make not return an effect since you only call ZIO.succeed in it. make can return directly a CounterService and that way no need to call unsafeRun in your main app. I also think that the HttpRoutes class is not really necessary since it only has a single method ...


1

A few observations about your code. incomplete - As you've noted, it doesn't handle Int overflow. It also doesn't handle the optional leading + character. digit characters - The variables charMap and keyMap are unnecessary. The .isDigit and .asDigit methods in the standard library provide the same functionality. Boolean logic - Consider this Boolean test: ...


2

The suggestions I'd make are all around making the code more robust and more explicit in error handling. Representing errors Your methods return Strings. However, I'd say that's not really a good representation of what the methods do. Here's what I mean... getJiraID can fail. You've checked for this in an assert, which is great. That will give an ...


Top 50 recent answers are included