[Haskell] simplex method?