Doing second assignment the Haskell way