Skip to content

Optimize >> and << in compiled JS#219

Merged
jfmengels merged 1 commit intomainfrom
optimize-composition
Jul 15, 2024
Merged

Optimize >> and << in compiled JS#219
jfmengels merged 1 commit intomainfrom
optimize-composition

Conversation

@jfmengels
Copy link
Copy Markdown
Owner

This effectively changes Elm's core >> and << from (roughly)

(<<) g f x =
  g (f x)

-- to

(<<) g f =
  \x ->
    g (f x)

In other words, the composition functions are now wrapped in F2 instead of F3, which yields much better performance because it gets applied using A2(composeL, f, g) in practice.

@jfmengels
Copy link
Copy Markdown
Owner Author

Reflects the changes done in elm/core#1145

@jfmengels jfmengels merged commit 301d083 into main Jul 15, 2024
@jfmengels jfmengels deleted the optimize-composition branch July 15, 2024 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant