8000 Functions from other modules are never inlined · Issue #1065 · melange-re/melange · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Functions from other modules are never inlined #1065
Open
@rniii

Description

@rniii

As an example, here's a function composition operator:

let (>>) f g x = f (g x)

Using it from the same file as it is defined always gets the function inlined --

let logPlusTwo = Js.log >> ((+) 2)
function logPlusTwo(param) {
  console.log(2 + param | 0);
}

But when moving the operator to something like an Utils module, the inlining never happens, which makes the output unnecessarily large. Explicitly annotating it with [@inline] also doesn't seem to do anything.

Is this a limitation with the build system working file-by-file? If so, is there any workaround?

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

      0