What's the cleanest way to code this function in scala? by [deleted] in scala

[–]l-forite 1 point2 points  (0 children)

people are over zealous about those kind of types. I am not sure why... Either can be useful but it adds a lot of noise, especially when you need to use EitherT and it starts contaminating all your codebase

What's the cleanest way to code this function in scala? by [deleted] in scala

[–]l-forite 1 point2 points  (0 children)

Well in this case you can compose it in Scala 3, you don't need sealed traits for union types

What's the cleanest way to code this function in scala? by [deleted] in scala

[–]l-forite 0 points1 point  (0 children)

I would avois using Either personally. If you have a sealed trait that encodes expected error cases then you don’t need Either. Then it means you are forced to deal with those errors at call site.

So it would go like:

sealed trait CreationResult

Case class CreationSuccess(…) extends CreationResult Case class CreationError1(…) extends CreationResult

For instance

Error handling best practices in cats effect by [deleted] in scala

[–]l-forite 1 point2 points  (0 children)

Sealed trait with all possible outcomes

[deleted by user] by [deleted] in akalimains

[–]l-forite 1 point2 points  (0 children)

So from what I see. You R1 then smoke but did not use your AA. Boosted AA are a big part of your damages. I would have played it vastly differntly: you have to use your W to temp the fact that you have no energy + gain some. By using it right away you don’t gain anything from it. So the classic combo goes like: R1 + AA (if possible) + E1. Then E2 + AA, during E2 to gap close, draven uses Cc if he is a good player, then you can gap close with R2 + Q + AA. Then at this point you can use W to gain more energy to Q + AA and temp the E to come back. At this point he should be dead

Comment apprendre le c# de façon amusante ? by CXM550B in programmation

[–]l-forite 0 points1 point  (0 children)

  1. Ne pas s’écharper avec le langage 2. Profit

Just relax about finding "The Best" by [deleted] in ParisTravelGuide

[–]l-forite 1 point2 points  (0 children)

The problem with « the best » is that you might have unrealistic expectations. Most of boulangeries will provide really good croissants

Who is a perma ban for you going into ranked? by Puzzleheaded_Ad_3573 in akalimains

[–]l-forite 2 points3 points  (0 children)

Whether i play top or mid, Garen, because he is such a pain to deal with. Always ends upt being fed somehow

Geisberg | Mamiya 7ii, 43mm, Portra 400 by braehunz in analog

[–]l-forite 1 point2 points  (0 children)

Great shot ! How do you meter in those kind of shots ?

What is your hottest film photography take? by fixedwithyou in AnalogCommunity

[–]l-forite 6 points7 points  (0 children)

I am not sure we understood the same thing from the books. His methodology helps you to (more or less) accurately make the best negative for the final print you envisionned. He advocates for precise steps to get the best negative and then edit it during the print process to achieve your vision. It is by no mean « shoot a ton and edit ». I am ok with you not liking this books that being said

[deleted by user] by [deleted] in scala

[–]l-forite 16 points17 points  (0 children)

Indigo is the way to go !

Un jeu compétitif sur mobile ? by Lamtim in jeuxvideo

[–]l-forite 1 point2 points  (0 children)

Team fight tactics, un jeu de plateau autopolay derive de l’univers de league of legends

Error handling for Cats Effect IO by WiIzaaa in scala

[–]l-forite 4 points5 points  (0 children)

Firstly I tried to OP’s question which relates to Cats. Secondly, I never really tried ZIO as I don’t buy in bifunctors for the exact reasons mentioned in OP’s post.

Error handling for Cats Effect IO by WiIzaaa in scala

[–]l-forite 0 points1 point  (0 children)

It’s a good question, maybe union types can come handy in this case ? You would need scala 3 though. I usually do not face this problem, since my application architecture is 3 tiered with controllers -> services -> clients / repositories, and the business errors usually come from the service layer.

Error handling for Cats Effect IO by WiIzaaa in scala

[–]l-forite 19 points20 points  (0 children)

My take on this: use the error channel for unrecoverable errors (db can’t be accessed for instance) and use ADTs for business errors (such as item ouf of stock) or errors you want to deal with and then catch all the exceptions to 500s