Frank Thomas

Results 290 comments of Frank Thomas

Agreed. The string representation of a predicate should not be the concern of the `Predicate` type class.

I'd like to add that we can't use something like `cats.Show` here because it has only one type parameter (`Show[T] { def show(t: T): String }`) but what we need...

Currently the `F` is not needed to show a `T` in the context of a predicate `P`. Would the string representation differ for different `F`s? For me, the `F` (which...

Just a remark: `Show` would also be beneficial for aliases like `type GreaterEqual[N] = Not[Less[N]]`. The `Validate` instance for `GreaterEqual[N]` gets currently assembled from a `Validate` for `Not` and `Less`...

This could be also an opportunity to address #104.

You're right @kusamakura. This is painful lesson in keeping type classes focused on one concern.

BTW: a special exception for failed refinements can be observed in the wild: https://github.com/advancedtelematic/rvi_sota_server/blob/97d641d22a7d89ff4901040f6c35e560b6da1964/common/src/main/scala/org/genivi/sota/marshalling/RefinmentError.scala :-)

:+1: Operations like these are not in the library yet, but they would be a welcome addition. It was brought up before on Gitter by @howyp who also started working...

With the addition of "companions" for predefined refined types there is now a suitable place for operations with these types. For example, I experimented with addition of `NonNegInt`s here: https://github.com/fthomas/refined/blob/76d812c3508e45e6413914dd76a81908ae5cf1db/modules/core/shared/src/main/scala/eu/timepit/refined/types/numeric.scala#L19-L28...

Awesome @ysusuk! Is there an easy way to run them?