On Mon, 02 Mar 2009 15:18:17 +0100, friggin friggin <[email protected]> wrote:

http://hpaste.org/fastcgi/hpaste.fcgi/view?id=1989#a1990


Is the algorithm wrong ar am I using it wrong?


The second parameter of extractTree is of type Tree a, you didn't suply a line specifying what to do with the value (Leaf a), so you didn't cover all possibilities of this type; that's why you get the message "Non-exhaustive patterns in function extractTree".

Also, is the second argument to shuffle supposed to eb random numbers, ie
the function should be used in the IO Monad?

If you supply a prefabricated random list of Integers, this function can be pure (i.e. not in the IO monad)

--
Met vriendelijke groet,
Henk-Jan van Tuyl


--
http://functor.bamikanarie.com
http://Van.Tuyl.eu/
--


_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to