I’ve seen frequently on the web, IRC, or stackoverflow, people asking how to time the execution of their haskell functions, and while there are packages for it, there is a simple alternative to them, or to compiling and using time
.
Simply fire up ghci with your program, and enter
> :set +s
into the prompt.
Now, after any evaluation of any function, ghc will tell you the time and memory that it took. Enjoy!