Re: [Haskell-cafe] Type of (>>= f) where f :: a -> m b

2010-05-10 Thread Brandon S. Allbery KF8NH
On May 10, 2010, at 05:51 , Milind Patil wrote: There seems to something special about (>>=) apart from its type. And whats (Monad ((->) b))? I am new to Haskell and I may have gaps in my understanding of type inference in Haskell. Everyone else having answered the first question, I'll tak

Re: [Haskell-cafe] Type of (>>= f) where f :: a -> m b

2010-05-10 Thread David Menendez
On Mon, May 10, 2010 at 5:51 AM, Milind Patil wrote: > For a function > > f ::  a -> m b > f = undefined > > I am having trouble understanding how the type of > > (>>= f) > > is > > (>>= f) :: m a -> m b > > where, by definition, type of (>>=) is > > (>>=) :: (Monad m) => m a -> (a -> m b) -> m b

Re: [Haskell-cafe] Type of (>>= f) where f :: a -> m b

2010-05-10 Thread Miguel Mitrofanov
(>>= f) is equivalent to (flip (>>=) f), not to ((>>=) f). You can try this with your own function this way: (&$^) :: (Monad m) => m a -> (a -> m b) -> m b (&$^) = undefined :t (&$^ f) Milind Patil wrote: For a function f :: a -> m b f = undefined I am having trouble understanding how the

[Haskell-cafe] Type of (>>= f) where f :: a -> m b

2010-05-10 Thread Milind Patil
For a function f :: a -> m b f = undefined I am having trouble understanding how the type of (>>= f) is (>>= f) :: m a -> m b where, by definition, type of (>>=) is (>>=) :: (Monad m) => m a -> (a -> m b) -> m b I do not see how (>>= f) even unifies. I mean if I code a function with th