I read the purescript wiki and found the next section that explains doin terms >>=.
do
>>=
What does it mean >>=?
MarkThe do keyword introduces simple syntactic sugar for a monadic expression.Here is an example using a monad for a type Maybe: maybeSum :: Maybe Number -> Maybe Number -> Maybe Number maybeSum a b = do n <- a m <- b let result = n + m return result maybeSumtakes two values of the type Maybe Numberand returns their sum if none of them is Nothing.When using notation, there must be an appropriate instance of a class of type Monad for the return type. Applications may take the following form:a <- xwhich desugars on x >>= \a -> ...xwhich desugars on x >>= \_ -> ...or just x if this is the last statement.let a = x. in.maybeSum desugars to:: maybeSum a b = a >>= \n -> b >>= \m -> let result = n + m in return result
Mark
The do keyword introduces simple syntactic sugar for a monadic expression.
Here is an example using a monad for a type Maybe:
Maybe
maybeSum :: Maybe Number -> Maybe Number -> Maybe Number maybeSum a b = do n <- a m <- b let result = n + m return result
maybeSumtakes two values of the type Maybe Numberand returns their sum if none of them is Nothing.
maybeSum
Maybe Number
Nothing
When using notation, there must be an appropriate instance of a class of type Monad for the return type. Applications may take the following form:
a <- x
x >>= \a -> ...
x
x >>= \_ -> ...
let a = x
in
maybeSum desugars to::
maybeSum desugars to
maybeSum a b = a >>= \n -> b >>= \m -> let result = n + m in return result
>>= - , . Prelude (>>=) :: forall m a b. (Bind m) => m a -> (a -> m b) -> m b, bind bind. Prelude , .
(>>=) :: forall m a b. (Bind m) => m a -> (a -> m b) -> m b
bind
Monad Haskell, . SO , , ( ).
Monad
Source: https://habr.com/ru/post/1626951/More articles:Why, after starting the server socket and using shutdown (), do I have a file in this directory? - cHow to capture server events in knitting - javascriptHow to extract variable name and value from string in python - variablesPhonegap - navigator.app.exitApp () not working - javascript403 при публикации в почтальоне с помощью Yeoman Angular -Fullstack - angularjsКак извлечь город, страну, широту и долготу из результата google places - google-mapshttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1626953/using-systemjs-to-load-files-for-cordova-app&usg=ALkJrhh3mMUoYvVfjRs8sNPI-s-Rnc_0wQHow does decltype work? - c ++jQuery - use css in if if argument - javascriptSpark + Scala transformations, immutability and memory overhead - scalaAll Articles