Solutions using Haskell