You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Depending on this project's attitude toward breaking changes, it may be worth changing CCOption.bind : 'a option -> ('a -> 'b option) -> 'b option to align with the current type of CCParse.bind : ('a -> 'b CCParse.t) -> 'a CCParse.t -> 'b CCParse.t. I suggest this, rather than vice versa, to facilitate patterns like return x |> bind f |> bind g, following the general principle that a function's final argument should be the argument to which that function is least likely to be "partially" applied.
Making the types of all bind functions consistent throughout the library will make it easier to write functors that expect monads as well and help keep interfaces to CC modules predictable. As far as I can tell, these two are the only instances of bind throughout containers.
The text was updated successfully, but these errors were encountered:
Depending on this project's attitude toward breaking changes, it may be worth changing
CCOption.bind : 'a option -> ('a -> 'b option) -> 'b option
to align with the current type ofCCParse.bind : ('a -> 'b CCParse.t) -> 'a CCParse.t -> 'b CCParse.t
. I suggest this, rather than vice versa, to facilitate patterns likereturn x |> bind f |> bind g
, following the general principle that a function's final argument should be the argument to which that function is least likely to be "partially" applied.Making the types of all
bind
functions consistent throughout the library will make it easier to write functors that expect monads as well and help keep interfaces toCC
modules predictable. As far as I can tell, these two are the only instances ofbind
throughout containers.The text was updated successfully, but these errors were encountered: