One of the few places where I wish Scala's type system were _more_ powerful: existential types.
@Eigenvariable well, like @jco says, it provides it via type members. That's just hella awkward sometimes.
-
-
@Eigenvariable@jco (but also I *don't* have a good grasp of theory so am probably missing something :) -
@avibryant@Eigenvariable Jeff, dunno if you can be bothered, but a gist of what you wished you could do and what you actually did would be+ -
@avibryant@Eigenvariable interesting -
@jco@avibryant I'll see what I can come up with. Basically I have a list whose elements all have abstract types... -
@jco@avibryant and I want to iterate over that to return a function whose type is calculated in terms of the elements of the list. -
@jco@avibryant e.g. given [x, y, z], I'd be returning Bar[(((), x.A), y.A), z.A)] -
@jco@avibryant And I can do that with a fold, returning Bar[X] forSome {type X}. But then I also need a Codec[X]. -
@jco@avibryant I can produce something like val p: (Bar[X], Codec[X]) forsome {type X}, but then when I try to use p._1 and p._2... - 4 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.