makes sense, not sure how you guys generate the bo...
# functional
r
makes sense, not sure how you guys generate the boilerplate now but an alternative would be to use type classes extensions if you are in the same compilation unit. One could think as instances being templates for codegen since they are already enforced to be parametric to a certain type that when used in higher kind poisition it represents a template. This would be the oposite of
deriving
. for example:
Copy code
interface Functor<F<_>>  {
    fun <A, B> map(fa: F<A>, f: (A) -> B): F<B>
    fun <A, B> lift(f: (A) -> B): (F<A>) -> F<B> =
            { fa: F<A> ->
                map(fa, f)
            }
}

template class ListFunctor : Functor<List> 
//enforces List<A> to implement `map` but gets `lift` for free in its applied //monomorfic version instead of an extension