Bind is used when you you have to deal with functions that cross between the normal world and the Monadic world.
For example say, you have a function which returns a monad:
vardb=(name)=>reader(()=>name);
The function returns a reader, so bind can be used to compose by unwrapping the value (i.e. to avoid getting a monad of a monad)
The concept can be found in any functional languages and not only, although the name may change. Another common name for bind is flatMap.
If you know Java you have probably used flatMap to avoid getting an optional of an Optional.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi Andrea!
Bind is used when you you have to deal with functions that cross between the normal world and the Monadic world.
For example say, you have a function which returns a monad:
The function returns a reader, so bind can be used to compose by unwrapping the value (i.e. to avoid getting a monad of a monad)
Does that make sense?
The concept can be found in any functional languages and not only, although the name may change. Another common name for bind is flatMap.
If you know Java you have probably used flatMap to avoid getting an optional of an Optional.