Skip to content

The async operator should be able to "lift" functions #19

@rmhsilva

Description

@rmhsilva

Is your feature request related to a problem? Please describe.

Often, I want to pass a Python function around (e.g. to map), but always call it asynchronously. Currently, the only way to do that is wrap it:

fn foo_async(x) {
  async foo(x)
}
// ...
map(foo_async, items)

Where map takes a function pointer.

Describe the solution you'd like

I'd like to be able to do:

map(async foo, items)

Implementation

At compile-time, async foo should create a new https://wiki.haskell.org/Lifting version of foo which always runs asynchronously. This could work similar to the import lifting (see wrap_foreign_function in https://github.com/condense9/teal-lang/blob/master/src/hark_lang/hark_compiler/compiler.py).

The parser rules would need to be modified too.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions