Kleisli composition operator

Hi, I'm obviously missing something basic here but I don't seem to be able to use the >=> operator which is apparently defined in the Prelude and also in Control.Monad. My imports are: import Prelude hiding (abs, lookup, init) import Data.Maybe import Data.List as List hiding (lookup, insert, delete, union, init) import Data.Map as Map hiding (update, delete, union, null, findIndex) import qualified Data.Tree as Tree import Control.Monad import Control.Monad.State Any suggestions anyone? thanks, Roly Perera

I'm obviously missing something basic here but I don't seem to be able to use the >=> operator which is apparently defined in the Prelude and also in Control.Monad.
Sorry, I wasn't very clear in my original posting. What I meant to say is that the compiler seems to be unable to find a definition of >=>. I get the message: Not in scope: `>=>' My understanding is that I shouldn't need to import this at all by default, and that importing Control.Monad should also pick it up.
My imports are:
import Prelude hiding (abs, lookup, init)
import Data.Maybe import Data.List as List hiding (lookup, insert, delete, union, init) import Data.Map as Map hiding (update, delete, union, null, findIndex) import qualified Data.Tree as Tree import Control.Monad import Control.Monad.State
Any suggestions anyone?
thanks, Roly Perera

On Sun, 2008-08-03 at 14:52 +0000, Roly Perera wrote:
I'm obviously missing something basic here but I don't seem to be able to use the >=> operator which is apparently defined in the Prelude and also in Control.Monad.
Sorry, I wasn't very clear in my original posting. What I meant to say is that the compiler seems to be unable to find a definition of >=>. I get the message:
Not in scope: `>=>'
My understanding is that I shouldn't need to import this at all by default, and that importing Control.Monad should also pick it up.
It's not in the Prelude but it is in Control.Monad in base version 3 and later. You're probably using an older GHC which has base version 2.x. You can define it locally: -- | Left-to-right Kleisli composition of monads. (>=>) :: Monad m => (a -> m b) -> (b -> m c) -> (a -> m c) f >=> g = \x -> f x >>= g Duncan

Am Sonntag, 3. August 2008 16:52 schrieb Roly Perera:
I'm obviously missing something basic here but I don't seem to be able to use the >=> operator which is apparently defined in the Prelude and also in Control.Monad.
Sorry, I wasn't very clear in my original posting. What I meant to say is that the compiler seems to be unable to find a definition of >=>. I get the message:
Not in scope: `>=>'
My understanding is that I shouldn't need to import this at all by default, and that importing Control.Monad should also pick it up.
My imports are:
import Prelude hiding (abs, lookup, init)
import Data.Maybe import Data.List as List hiding (lookup, insert, delete, union, init) import Data.Map as Map hiding (update, delete, union, null, findIndex) import qualified Data.Tree as Tree import Control.Monad import Control.Monad.State
Any suggestions anyone?
thanks, Roly Perera
Which implementation are you using? IIRC, GHC didn't have it in Control.Monad before the 6.8 branch.

Daniel Fischer
Which implementation are you using? IIRC, GHC didn't have it in Control.Monad before the 6.8 branch.
Duncan Coutts
It's not in the Prelude but it is in Control.Monad in base version 3 and later. You're probably using an older GHC which has base version 2.x.
Thanks for the quick responses. Looks like I need to install a version later than 6.8. Roly

On Sun, 2008-08-03 at 15:31 +0000, Roly Perera wrote:
Daniel Fischer
writes: Which implementation are you using? IIRC, GHC didn't have it in Control.Monad before the 6.8 branch.
Duncan Coutts
writes: It's not in the Prelude but it is in Control.Monad in base version 3 and later. You're probably using an older GHC which has base version 2.x.
Thanks for the quick responses. Looks like I need to install a version later than 6.8.
GHC 6.8 comes with base-3 so has (>=>) in Control.Monad. Duncan
participants (3)
-
Daniel Fischer
-
Duncan Coutts
-
Roly Perera