Algorithms for unconstrained optimization in Haskell