RE: ghc-CVS 001024: minor hslibs dependency bug

2000-10-25 Thread Simon Marlow

 The dependency "concurrent" should be added to line 11 of
 /hslibs/net/Makefile so that it becomes:
 
 HSLIB_DEPS = lang text concurrent
 
 After that fix, 'make boot' goes through.

Thanks, I've applied your fix.

Cheers,
Simon

___
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs



False duplicate or overlapping instances message

2000-10-25 Thread George Russell

When I compile the attached file on Linux with 4.08.1:
   /home/ger/ghc-4.08.1-binary/bin/ghc -c Instances.hs -fglasgow-exts 
-fallow-overlapping-instances -fallow-undecidable-instances
I get the message:

Instances.hs:1:
Duplicate or overlapping instance declarations
for `HasConfig (arcTypeConfig value) (arcTypeParms value)'
defined at Instances.hs:19 and defined at Instances.hs:11

This is not fair, because while the instances for HasConfig have the
potential to conflict in the future, they will only do so should the classes
NodeTypeConfigParms and ArcTypeConfigParms overlap.
 Instances.hs


Re: False duplicate or overlapping instances message

2000-10-25 Thread Keith Wansbrough

 Instances.hs:1:
 Duplicate or overlapping instance declarations
 for `HasConfig (arcTypeConfig value) (arcTypeParms value)'
 defined at Instances.hs:19 and defined at Instances.hs:11
 
 This is not fair, because while the instances for HasConfig have the
 potential to conflict in the future, they will only do so should the classes
 NodeTypeConfigParms and ArcTypeConfigParms overlap.

It is fair.  Let's rename your type variables to make what's going on a little clearer:

  main = return ()
  
  class HasConfig a b where
 ($$) :: a - b - b
  
  class NodeTypeConfigParms a b where
 nodeTypeConfig :: a c - b c - b c
  
  instance (NodeTypeConfigParms a b) = HasConfig (a c) (b c) where
 ($$) = nodeTypeConfig
  
  class ArcTypeConfigParms a b where
 arcTypeConfig :: a c - b c - b c

  instance (ArcTypeConfigParms a b) = HasConfig (a c) (b c) where
 ($$) = arcTypeConfig
  
  
You can now see that the two instance declarations overlap: their
right hand sides are in fact *identical*.  Remember that the
typechecker simply matches on the right-hand sides ("heads") of the
instance declarations.

If you do -fallow-undecidable-instances, I think your program will
work (in the Prolog-ish backtracking way), but note that if
NodeTypeConfigParms and ArcTypeConfigParms are ever given instances at
the same pair of types, the value of ($$) will be undefined.

--KW 8-)

___
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs



Re: False duplicate or overlapping instances message

2000-10-25 Thread George Russell

Keith Wansbrough wrote:
 
  Instances.hs:1:
  Duplicate or overlapping instance declarations
  for `HasConfig (arcTypeConfig value) (arcTypeParms value)'
  defined at Instances.hs:19 and defined at Instances.hs:11
 
  This is not fair, because while the instances for HasConfig have the
  potential to conflict in the future, they will only do so should the classes
  NodeTypeConfigParms and ArcTypeConfigParms overlap.
 
 It is fair.  Let's rename your type variables to make what's going on a little 
clearer:
 
   main = return ()
 
   class HasConfig a b where
  ($$) :: a - b - b
 
   class NodeTypeConfigParms a b where
  nodeTypeConfig :: a c - b c - b c
 
   instance (NodeTypeConfigParms a b) = HasConfig (a c) (b c) where
  ($$) = nodeTypeConfig
 
   class ArcTypeConfigParms a b where
  arcTypeConfig :: a c - b c - b c
 
   instance (ArcTypeConfigParms a b) = HasConfig (a c) (b c) where
  ($$) = arcTypeConfig
 
 
 You can now see that the two instance declarations overlap: their
 right hand sides are in fact *identical*.  Remember that the
 typechecker simply matches on the right-hand sides ("heads") of the
 instance declarations.
No they do not overlap, unless there is an a b satisfying NodeTypeConfigParms a b
and ArcTypeConfigParms a b.  Which there aint.
 
 If you do -fallow-undecidable-instances, I think your program will
 work (in the Prolog-ish backtracking way), but note that if
 NodeTypeConfigParms and ArcTypeConfigParms are ever given instances at
 the same pair of types, the value of ($$) will be undefined.
As a matter of fact I DID use -fallow-undecidable-instances, as you can see
from my original contribution . . .

___
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs



Re: False duplicate or overlapping instances message

2000-10-25 Thread George Russell

Keith Wansbrough wrote:
 
   You can now see that the two instance declarations overlap: their
   right hand sides are in fact *identical*.  Remember that the
   typechecker simply matches on the right-hand sides ("heads") of the
   instance declarations.
  No they do not overlap, unless there is an a b satisfying NodeTypeConfigParms a b
  and ArcTypeConfigParms a b.  Which there aint.
 
 Haskell makes the "open world" assumption... there may be new
 instances added later, and the behaviour of a well-typed program
 should not change if this occurs.
 
 I'll defer further discussion of this to the experts (Mark Jones?).
I think I've worked out what's going on now.  But I don't like it.  
When I use -fallow-undecidable-instances and -fallow-overlapping-instances
(as I did) I was assuming (like Keith Wansbrough did) that GHC would do a 
Prolog-style backtracking search when it was time to resolve an overloading,
and would only complain if there were more or fewer than one chain of inferences.
Instead Haskell eagerly tries to anticipate possible conflicts, which is a nuisance
when it is obvious (as it is to me in this case) that such conflicts are unlikely
to arise.  For a simpler example, imagine that we have two classes
Integral a (things corresponding to integers) and String a (things corresponding to
strings).  It is a pity that we cannot write

instance Integral a = Show a
   and
instance String a = Show a

just because someone may come along later on and try to show something which is an
instance of both Integral and String.  (Though obviously if they do, we DO need an
error message.)

___
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs