Simplified Haskell implementation of Bruno Škvorc's programming assignment