[Haskell-beginners] Class and Instance Question

Daniel Fischer daniel.is.fischer at googlemail.com
Fri May 20 10:02:58 CEST 2011


On Friday 20 May 2011 06:08:30, Antoine Latter wrote:
> 
> A key point about instance resolution - when GHC tries to find an
> instance to useit only looks at what is on the left-hand side of the

Antoine meant right-hand side here, of course.

> (=>) mark.
> 
> So an instance of the form:
> > instance (Constraint a) => MyClass [a] where ...
> 
> can be read aloud as:
> 
> "[a] is an instance of MyClass. Also, it is an error if Constraint a
> is not satisfied".
> 



More information about the Beginners mailing list