Unresolved top-level overloading 
Author Message
 Unresolved top-level overloading

Hi,

Can some please explain what this HUGS error means?  The following
trivial program demonstrates the problem.

If I load the following program into HUGS 1.4

--- snip ---
max' = max
--- snip ---

I get the following error message:

ERROR "/tmp/hugs4416uN" (line 1): Unresolved top-level overloading
*** Binding             : max'
*** Outstanding context : Ord b

I can resolve the problem by writing

max' :: Ord a => a -> a -> a
max' = max

but I'm not sure why this is necessary.  Note that the type I've
specified for max' is the same as the type of max.  I would have
thought max' would automatically be the same type as max unless I
specified a more specialized type.  This is in fact what seems to
happen when the binding isn't a top-level binding.

Thank you in advance.

--
Adam P. Jenkins



Thu, 26 Jul 2001 03:00:00 GMT  
 Unresolved top-level overloading
Hi Adam,

Quote:
>If I load the following program into HUGS 1.4

>--- snip ---
>max' = max
>--- snip ---

>I get the following error message:

>ERROR "/tmp/hugs4416uN" (line 1): Unresolved top-level overloading
>*** Binding             : max'
>*** Outstanding context : Ord b

>I can resolve the problem by writing

>max' :: Ord a => a -> a -> a
>max' = max

>but I'm not sure why this is necessary.

You are yet another victim of the evil monomorphism restriction. Have a look
at the Haskell'98 report for an explanation and motivation
(http://haskell.systemsz.cs.yale.edu/onlinereport/decls.html)

Erik "don't like the MR either" Meijer



Fri, 27 Jul 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Keeping top level on top.

2. Unresolved Overloading

3. Haskell typing problems (Unresolved Overloading)

4. unresolved overloading (in Hugs 1.4)

5. Info please - High Level Assembler - USING at top of page

6. Top Level VI and SubVI Execution

7. running multiple instances of a top level vi

8. top-level VIs

9. Help with this vi and top level vi's

10. front panel of top-level vi in executable

11. hide top level VI

12. VO, Single keystroke to top level menu

 

 
Powered by phpBB® Forum Software