Skip to content

Instantly share code, notes, and snippets.

@jakedouglas
Created May 5, 2011 01:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakedouglas/956345 to your computer and use it in GitHub Desktop.
Save jakedouglas/956345 to your computer and use it in GitHub Desktop.
// How do I make the 'f' function parameterized by the type of the implicit?
def cas[T](key: Array[Byte],
ttl: Int = 0)
(f: Option[T] => Option[T])
(implicit transcoder: Transcoder[T] = defaultTranscoder): Boolean = { ... }
// trying to compile this usage fails. would like to avoid using c.cas[SomeType](key)
c.cas(key) { value => ... }
// [error] missing parameter type
// [error] Error occurred in an application involving default arguments.
// [error] c.cas(key) { value =>
// [error] ^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment