Haskell symbolic calculator pre-monad