Skip to content

Optimizing psc with psc-bundle against webpack + uglify or other tools #2204

@wegry

Description

@wegry

In Purescript 0.8, a Purescript function like w x y z = z is output as

var w = function (x) {
     return function (y) {
        return function (z) {
            return z;
        };
    };
};
// 122 bytes

An option would be added to psc to output this instead with => and instead be output as the following: var w = x => y => z => z; // 25 bytes

It might be easier to have the final function always be wrapped in curly braces:

var w = x => y => z => { 
    return z;
}; // 42 bytes

An identity function would go from

var id = function (x) {
    return x;
}; // 40 bytes

to var id = x => x; // 16 bytes

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions