Skip to content

[TS] Code generation error #16

Description

@sharpvik

The following derw code defines a lambda of type string -> string.

main: string -> string
main = \name -> `Hello ${name}`

Running derw compile on this results in the following output:

function main(_0: string): string {
    return function(name: any) {
        return `Hello ${name}`;
    };
}

which declares that main is a string -> string but in reality, main: string -> any -> string as is evident from the code.

However, using the regular function notation like so

main: string -> string
main name = `Hello ${name}`

fixes the problem:

function main(name: string): string {
    return `Hello ${name}`;
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions