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? Thanks a lot, Sascha -- Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
On Wed, Jan 10, 2007 at 03:33:44PM +0100, "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?
Prelude> :t \a b -> (Control.Monad.Trans.lift a >> b) \a b -> (Control.Monad.Trans.lift a >> b) :: (Monad (t m), Control.Monad.Trans.MonadTrans t, Monad m) => m a -> t m b -> t m b
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
participants (3)
-
"Sascha Böhme" -
Stefan O'Rear -
Wolfgang Lux