Skip to content

Instantly share code, notes, and snippets.

@dasch
Last active December 13, 2024 09:26
Show Gist options
  • Save dasch/b11324ec50a5de9e3e460996b795b6e0 to your computer and use it in GitHub Desktop.
Save dasch/b11324ec50a5de9e3e460996b795b6e0 to your computer and use it in GitHub Desktop.
Before and after:
double = \x -> 2 * 2
double = x -> 2 * 2
mult = \x, y -> x * y
mult = x, y -> x * y
fullName = \{ first, last } -> "$(first) $(last)"
fullName = { first, last } -> "$(first) $(last)"
people.map(\p -> p.age)
people.map(p -> p.age)
people
|> List.map \p -> p.age
people
|> List.map p -> p.age
app = {
init: \config -> State config,
update: \state, input -> doSomething state input
}
app = {
init: config -> State config,
update: state, input -> doSomething state input # <- this is problematic; maybe `(state, input) -> ...`?
}
fns = [\x -> x * 2, \x -> x * 3]
fns = [x -> x * 2, x -> x * 3]
something! \{} -> foobar!
something!({} -> foobar!)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment