Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is "bind" written as >>= in Haskell Monads?

Tags:

haskell

monads

What are the origins of the syntax ">>=" and ">>" in Haskell Monads? I'm not looking for a explanation of how Monads work but instead why the language designers chose that syntax. To me, ">>=" and ">>" seems kind of arbitrary and never made intuitive sense. Does anyone have a intuitive explanation? Is it syntax that comes from category theory?

like image 408
keyworks Avatar asked Apr 15 '14 20:04

keyworks


1 Answers

m >>= k suggests "feed the result of computation m to the function k"; m >> n suggests "run the m computation and then the n computation".

like image 86
duplode Avatar answered Sep 27 '22 18:09

duplode