[Haskell-cafe] Re: beginner's problam with a monad

2006-09-03 Thread Benjamin Franksen
Julien Oster wrote:
 Now if anyone could enlighten me about the instance Monad Tracker a
 instead of instance Monad Tracker part, everything will be clear!

Hello Julien,

The way you defined it, Tracker is a type constructor with two arguments,
both of which are types; another way to state this is to say that Tracker
has kind (* - * - *). However, a monad is a type constructor with kind
* - *, i.e. it accepts only one type argument. This can be seen from the
class definition, where m is always used with one argument (i.e. 'm a'
or 'm b' and a and b are types).

Partially applying Tracker to one argument ('T a') gives you a type
constructor that has only one remaining 'open' argument and thus can be
made an instance of class Monad.

HTH,
Ben

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: beginner's problam with a monad

2006-09-03 Thread Julien Oster
Benjamin Franksen wrote:

 Partially applying Tracker to one argument ('T a') gives you a type
 constructor that has only one remaining 'open' argument and thus can be
 made an instance of class Monad.

Totally clear, thanks a lot (also to Keegan).

Julien

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe