HUGS error: Unresolved overloading

Ralf Krueger rkrueger@TechFak.Uni-Bielefeld.DE
Thu, 17 May 2001 13:56:20 +0200


David Scarlett wrote:
> 
> Can anyone shed some light on the following error? Thanks in advance.
> 
> isSorted :: Ord a => [a] -> Bool
> isSorted [] = True
> isSorted [x] = True
> isSorted (x1:x2:xs)
>         | x1 <= x2  = isSorted (x2:xs)
>         | otherwise = False
> 
> --------
[...]
> Main> isSorted []
> ERROR: Unresolved overloading
> *** Type       : Ord a => Bool
> *** Expression : isSorted []
> --------

The list constructor [] is overloaded, so it's type cannot be infered
inambigously. The empty list can be of any list type, HUGS cannot check
if it's parameter's type is an instance of Ord.

-- 
Ralf Krueger
E-Mail: rkrueger@TechFak.Uni-Bielefeld.DE
URL:    http://www.Ralf-Krueger.DE
Bielefeld University
Center for Interdisciplinary Research (ZiF)
WWW Administration
Wellenberg 1
33615 Bielefeld
Germany
Tel: ++49 521 106-2777