Skip to content

FreeS.pure should return FreeS.Par #549

Description

@n3ziniuka5

Sometimes you want to run operation in parallel that depends on a previous result that may be an option, for example:

for {
  someOption <- op1
  val op2 = someOption.map(op2).getOrElse(FreeS.pure(()))
  val op3 = someOption.map(op3).getOrElse(FreeS.pure(()))
  _ <- (op2, op3).tupled
} yield ()

Currently you cannot do this as FreeS.pure returns FreeS[F, A] and not FreeS.Par[F, A]. For now I just wrote an additional utilities algebra with one of the operations being pure and that gives me the type that allows for parallelism.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions