Have you ever wanted to define a default for a type parameter in Scala? Here's how:https://gist.github.com/propensive/8894fd2a58ac93bfa2c3 …
-
-
Replying to @propensive
@propensive hmm. this is clever and not obviously unethical ... trying to remember if I have ever wanted to do this.1 reply 0 retweets 1 like -
Replying to @tpolecat
@tpolecat@propensive not obviously ethical either if you ask me ;) I'm curious of the use case?5 replies 0 retweets 1 like -
Replying to @aloiscochard
@aloiscochard@tpolecat Sometimes we don't want to have to specify the type parameter, e.g. "extract a String unless I specify otherwise".1 reply 0 retweets 0 likes -
Replying to @propensive
@propensive@tpolecat do you have something really concrete, I mean a RealWorld(c) example? what that function you describe do?2 replies 0 retweets 0 likes
@aloiscochard @tpolecat I've used the trick loads of times before, rolled into an existing type class - this is my first generic attempt...
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.