1
votes

I want to know the difference between

-> , >>= and <-

in haskell and how to use them?

1
I'd recommend reading a monad tutorial. E.g. LYAH has a chapter dedicated to that topic. You will find many monad tutorial around the net if you google for them.chi
Your question shows zero effort of finding the answer yourself. You'll find the answer in any basic introduction to the language.Nikita Volkov

1 Answers

1
votes

a -> b is the function type. It describes a function that takes a type a and returns a type b.

>>= is the monadic bind function. It is of type Monad m => m a -> (a -> m b) -> m b. If you need to understand this, I recommend reading Learn You a Haskell for Great Good.

<- is syntactic sugar in a do block, where do {a <- b; c} translates as b >>= \a -> c, i.e, it's basically a nicer way of writing >>=.