[Haskell-beginners] When a return type constrained by class

Haisheng Wu freizl at gmail.com
Sun Mar 18 07:23:20 CET 2012


Hi there,
 Do you have any idea why the following code is not valid?

class Guess g where
 makeGuess :: g -> String

instance Guess GuessLetter where
 makeGuess = ...

instance Guess GuessWord where
 makeGuess = ...

*-- | This function is nod valid *
nextGuess :: Guess g => String -> g
nextGuess = ...


Thank you.

-Haisheng
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20120318/f1ec5771/attachment.htm>


More information about the Beginners mailing list