2 comments

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