May someone help me out here with Contravariant 🙂 . The Prelude looks like this:
class ForOp private constructor() {
companion object
}
typealias OpOf<A, X> = arrow.Kind2<ForOp, A, X>
typealias OpPartialOf<A> = arrow.Kind<ForEither, A>
@Suppress("UNCHECKED_CAST", "NOTHING_TO_INLINE")
inline fun <A, X> OpOf<A, X>.fix(): Op<A, X> =
this as Op<A, X>
@higherkind
data class Op<A, X>(val f: (X) -> A) {
fun <B> compose(other: Op<B, A>): Op<B, X> =
Op(other.f compose f)
fun <B> compose(g: (A) -> B): Op<B, X> =
compose(Op(g))
}
inline fun <A, X> Op<A, X>.k(): Kind2<ForOp, A, X> = TODO() // does that make sense?
now I want to define:
interface OpContravariant<C> : Contravariant<Conested<ForOp, C>>
How does that look like. I tried it, but I could not find something tangible.
cc
@Ariostonj