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

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -