You must have haskell already installed:
$ ghci
Prelude> :load longestpath.hs
[1 of 1] Compiling Main ( longestpath.hs, interpreted )
Ok, modules loaded: Main.
*Main> longestpath tree
[11,9,7,5,3,2,12,14,16,18,20]
*Main>
Instead of tree (which is an example), you can do your own tree and give it a try.
Ricardo Bernardelli