--
You received this message because you are subscribed to the Google Groups "rogue-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rogue-users...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Required is a reimplementation of <:< (from the Prelude). I wanted AddOrder[-In, +Out] to also enforce that In <: Unordered (it wouldn't make sense to add Ordered to something that was already Ordered). I could do that with 2 implicits at every call site (one to check In <:< Ordered and one to AddOrder), but I thought I could save some work by folding the <:< check into AddOrder, in other words, makin AddOrder[-In, +Out] extend In <:< Unordered. But <:< is sealed, so I had to reimplement it, and I called it Required. I suppose you could constrain A <: B, but Prelude doesn't, and I just copied that.
You could create an AddOrder[Ordered, Ordered] instance, but it wouldn't be that useful... AddOrder[A, B] is a type relation between type A and type B. So AddOrder[Ordered, Ordered] is essentially the identity function from Ordered to Ordered.
> However, is the fact that e.g. AddOrder extends Required ever used?Yes, it's used to enforce that In <: Unordered and to replace Unordered with Ordered in one go. I could do it with 2 separate implicits, but this just saved typing.
You received this message because you are subscribed to a topic in the Google Groups "rogue-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rogue-users/H-FyjIe-xlU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rogue-users...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.