psaxton wrote:
> 
> Thanks!
> 
> I have just tried your suggested solution.  Unfortunately it still gives out
> an error message, this time HUGS says
> 
> Error test.txt :Unresolvable top-level overloading
> ****Binding: sort
> ****Outstanding context: Ord b
> 

Hi,

You've hit to monomorphic restriction. 

Two possible solutions.

(1) Try put the type of your sort as a type signature.

sort :: (Ord a) => [a] -> [a]
sort = reduce insert []

(2) Add an extra argument explicitly.

sort xs = reduce insert xs

Hope this helps!

Andy
--
Principal Project Scientist, Pacific Software Research Center
Department of Computer Science and Engineering
Oregon Graduate Institute of Science & Technology
phone +1 503 748 7451       http://www.cse.ogi.edu/~andy

Reply via email to