[Haskell] Haskell 98 syntax question

Wolfgang Lux wlux at uni-muenster.de
Wed Jan 10 10:28:19 EST 2007


Sascha Böhme wrote:

> Hello,
>
> referring to the Haskell 98 report as available in the Internet, I  
> have a short question. Section 4.1.3 (Syntax of Class Assertions  
> and Contexts) contains the rule:
>
> class -> qtycls tyvar
>       |  qtycls ( tyvar atype1 ... atypen ) (n>=1)
>
> Is there a (simple) practical example of a Haskell type expression  
> using the second line of the above rule?

If you read a little bit further, you'll find the type
   (Eq (f a), Functor f) => (a -> b) -> f a -> f b -> Bool
in Sect 4.1.4. Another example can be found in Sect. 4.5.3:
   f :: (Monad m, Eq (m a)) => a -> m a -> Bool
   f x y = return x == y

Regards
Wolfgang



More information about the Haskell mailing list