Skip to content

Presence of return is misleading #38

@mexx

Description

@mexx

Given the following expression asyncSeq { return [1] }.
I would expect the type of it to be AsyncSeq<int>, unfortunately it is AsyncSeq<'a>.

I understand that in first place it's my wrong expectation about the result's presence, actually as it's a sequential workflow, it shouldn't be there at all.
By looking at the source code I know that the presence of return is caused by the wish to support the do! action functionality, as it's translated by the F# compiler into Bind(action, fun () -> Return()).
Could it be a F# compiler problem? What if the compiler would transform it to Bind(action, Zero()), then the resultreturn could be dropped right?

05.12.2015: corrected identifier

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions