2 comments

[ 3.7 ms ] story [ 13.6 ms ] thread
The generics in Scala should be able to catch the cases you mentioned. Definitely worth checking out.