Skip to content

Instantly share code, notes, and snippets.

@shajra
Created August 28, 2013 20:18
Show Gist options
  • Save shajra/6370695 to your computer and use it in GitHub Desktop.
Save shajra/6370695 to your computer and use it in GitHub Desktop.
Is there a way to avoid this kind of name collision?
def newExistential[S]
(producer: Inputs => S, consumer: S => Output)
: Existential = {
type SS = S
val producer_ = producer
val consumer_ = consumer
new Existential {
type S = SS
def producer(is: Inputs) = producer_(is)
def consumer(s: S) = consumer_(s)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment