Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added generic overload of TaskBuilderV2.For method #32

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

SLAVONchick
Copy link

@SLAVONchick SLAVONchick commented May 16, 2020

This PR solves problem of iterating over sequences that don't implement IEnumerable<'T>, e.g. System.Buffers.ReadOnlySequence<'T>.

After applying the changes you should be able to compile code like this:

open System.Text
open System.Buffers
open FSharp.Control.Tasks.V2

let readFromSequence (seq: ReadOnlySequence<byte>) = task {
    for segment in seq do 
        printfn "%s" <| Encoding.UTF8.GetString segment.Span
}

Please, @rspeele, give some feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant