bindM member constraint
glchapman opened this issue · 4 comments
glchapman commented
in ComputationExpressions/Monad.fs, bindM is defined as:
let inline bindM builder m f = (^M: (member Bind: 'd -> ('e -> 'c) -> 'c) (builder, m, f))
this is not strictly correct since Bind does not take curried arguments. It works anyway because the current fsharp compiler changes the constraint:
> let inline bindM builder m f = (^M: (member Bind: 'd -> ('e -> 'c) -> 'c) (builder, m, f));;
val inline bindM :
builder: ^M -> m:'d -> f:('e -> 'c) -> 'c
when ^M : (member Bind : ^M * 'd * ('e -> 'c) -> 'c)
When fsi echoes back the type of bindM, the member constraint has tupled arguments. You might want to fix this anyway in case the compiler ever changes.
panesofglass commented
Thank you! That's an excellent point!
gdziadkiewicz commented
This is still an issue.
panesofglass commented
See commit 7139b80
gdziadkiewicz commented
Fixed in 2.4.0