Skip to content

Move arguments to the right side of the =? #183

@shachaf

Description

@shachaf

We have definitions like

over l f = runMutator# (l (mutator# f))

If we turn this into

over l = \f -> runMutator# (l (mutator# f))

GHC can inline it better in a call like

foo :: (a -> b) -> [a] -> [b]
foo = over mapped

Since the application is saturated, even if foo doesn't end up getting inlined.

Our strategy in lens has mostly been "inline everything, and let GHC simplify it down to nothing at the use site", so this probably wouldn't cause any harm.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions