[nhc-bugs] Re: cvs commit: nhc98/src/libraries/base/Data Tree.hs

Ross Paterson ross at soi.city.ac.uk
Wed Feb 4 16:39:30 EST 2004


On Wed, Feb 04, 2004 at 02:51:18AM -0800, Malcolm Wallace wrote:
> malcolm     2004/02/04 02:51:18 PST
> 
>   Modified files:
>     src/libraries/base/Data Tree.hs 
>   Log:
>   Exclude functions 'unfoldTreeM' and 'unfoldForestM' in nhc98.
>   For some unknown reason they result in a type inference error:
>   "No default for Prelude.Monad"

Curious bug (in nhc98) -- it seems you need mutual recursion to trigger it,
as in:

	mapM_1 :: Monad m => (a -> m b) -> [a] -> m ()
	mapM_1 f [] = return ()
	mapM_1 f (x:xs) = f x >> mapM_2 f xs

	mapM_2 :: Monad m => (a -> m b) -> [a] -> m ()
	mapM_2 f [] = return ()
	mapM_2 f (x:xs) = f x >> mapM_1 f xs

Delete either signature and it goes away.


More information about the Nhc-bugs mailing list