Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@simpadjo
Copy link
Contributor

@simpadjo simpadjo commented May 4, 2020

No description provided.

@jdegoes
Copy link
Member

jdegoes commented May 5, 2020

@simpadjo Great idea! One comment on how to do it without the new class, then good to merge!

@adamgfraser
Copy link
Contributor

I'm inclined to think with the version specific files this is more complexity and maintenance burden at this point. What if we just do something like?

@implicitNotFound("Pattern guards are only supported when the error type is a supertype of NoSuchElementException. However, your effect has ${E} for the error type.")
sealed trait CanFilter[+E] {
  def apply(t: NoSuchElementException): E
}

object CanFilter {
  implicit def canFilter[E >: NoSuchElementException]: CanFilter[E] =
    new CanFilter[E] {
      def apply(t: NoSuchElementException): E = t
    }
}

@simpadjo
Copy link
Contributor Author

@adamgfraser @jdegoes Let's agree on something or flip a coin )

@jdegoes
Copy link
Member

jdegoes commented May 10, 2020

@simpadjo I'm on board with @adamgfraser's suggestion! 🍀

@simpadjo
Copy link
Contributor Author

Applied suggestions by @adamgfraser . Looks much cleaner now!
Also lots of confusion comes from using type annotations and tuple deconstruction.
Would be great to warn about it specifically, but don't know how to formulate it shortly and w/o dissing the compiler too much.
Js build is failing due to unrelated problems on master.

@simpadjo simpadjo requested a review from jdegoes May 16, 2020 13:17
adamgfraser
adamgfraser previously approved these changes Jun 3, 2020
Copy link
Contributor

@adamgfraser adamgfraser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your work on this!

@simpadjo
Copy link
Contributor Author

simpadjo commented Jun 4, 2020

@adamgfraser I rebased it. Let's merge it then?

@adamgfraser adamgfraser merged commit c3f8772 into zio:master Jun 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants