Skip to content

AsyncSeqBuilder is not compatible with HtmlContainer #239

@ThisFunctionalTom

Description

@ThisFunctionalTom

I am trying to use Oxpecker + ViewEngine with datastar and for that I decided to use AsyncSeq for the views which are then rendered and sent to the Client via PatchElementsAsync.

When trying to create AsyncSeq of views with computation expression it does not work. I get the error: repro.fsx(10,38): error FS0193: The type 'AsyncSeq.AsyncSeqBuilder' is not compatible with the type 'HtmlContainer'.

Without the computation expression everything works as expected.

Do you know what could be the problem? Is there maybe a workaround so that I can still use asyncSeq CE?

Small repro.fsx:

#r "nuget: Oxpecker.ViewEngine"
#r "nuget: FSharp.Control.AsyncSeq"

open FSharp.Control
open Oxpecker.ViewEngine

let myView (name: string) : HtmlContainer =
    h1() { name }

let main : AsyncSeq<HtmlContainer> = asyncSeq {
    yield myView "Hello, world"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions