scala theory