Some haskell code that did some reduction to do my homework for a bachelor course (long time ago)