scala - curry functions using generic type -
i trying use curry function typed class. goal classes extends class have define curried function . last failed attempt :
abstract class foo[t: ordering]{ def eval(x: t, y: t)(f:(t,t)=>option[boolean])(implicit ev:ordering[t] = null): option[boolean] = { if(ev == null) none else f(x,y) } } case object bar extends foo{ def xx[t: ordering] = (x:t,y:t)=>some(x>y) eval(xx) }
how should done correctly ?
Comments
Post a Comment