-
Notifications
You must be signed in to change notification settings - Fork 102
Open
Description
Background and motivation
A generalization of F# collection's concat
function.
Here's a possible generic definition let inline concat x = bind (toSeq >> ofSeq) x
.
But we have to define its expected behaviour with different types, and what are the constraints for the input types.
For instance, the above definition would require 'M<'F<'T>>
when M should be a monad (support for >>=
) and F a foldable (support for toSeq
) but it also should be a Collection (support for ofSeq
).
Tricky types are options, dictionaries. For instance a dictionary of options won't work with the above definition.
Alternative Concerns
What is the expectation forL
concat (dict [ (1, [1;2;3]); (3, [6;7;8]) ])
concat (Some [1; 3])
Are you willing help with a pull-request?
Maybe
Metadata
Metadata
Assignees
Labels
No labels