Why is there no generic 'bind' function?
See original GitHub issueI know there is the >>=
operator to pipe monads, but why is there no free-standing function named bind
? So that instead of x >>= f
one could write x |> bind x
. This is already possible with map
(<!>
or |>>
depending on operator order).
Issue Analytics
- State:
- Created 5 years ago
- Comments:13 (13 by maintainers)
Top Results From Across the Web
typescript - How to bind a parameter to a generic function
If the parameters do depend on the generic type parameter, though, Parameters<T> will lose track of any type parameter: declare function ...
Read more >Documentation - Generics
Without generics, we would either have to give the identity function a specific ... we'd get an array of numbers back out, as...
Read more >How To Use Generics in TypeScript
One of the most common scenarios for using generics with functions is when you have some code that is not easily typed for...
Read more >Generics - mypy 1.5.1 documentation
A variable cannot have a type variable in its type unless the type variable is bound in a containing generic class or function....
Read more >Racket Generic Binding Forms
When using ~define to define a function, any generic binding must be define-allowable. (So the ~vs values-binding form is not allowed.).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Personally I don’t need it but I don’t see any downside of adding it to F#+.
In the case when you’d browse the API using intellisense, it does makes sense to have bind defined. However, in parts of the library, Identity.fs#L18 they are defined differently than you’d expect from a
bind
(they are static members in order for this to work). You could expose the functions with f# signature in modules.