Test with typeclasses and functional dependencies