Skip to content

Commit b78a991

Browse files
committed
Have a more practical example on code (word counting)
1 parent 01302ef commit b78a991

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

src/components/home/hero-examples.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ export type Example = {
99
export const EXAMPLES: Example[] = [
1010
{
1111
title: "Composable data transformations",
12-
code: `"hello world"
12+
code: `"Fun to learn, delightful to ship"
13+
|> String.downcase()
14+
|> String.replace(",", "")
1315
|> String.split()
14-
|> Enum.map(fn word ->
15-
String.capitalize(word)
16-
end)
17-
|> Enum.join(" ")`,
18-
precanned: { value: `"Hello World"` },
16+
|> Enum.frequencies()`,
17+
precanned: {
18+
value: `%{"delightful" => 1, "fun" => 1,
19+
"learn" => 1, "ship" => 1, "to" => 2}`,
20+
},
1921
},
2022
{
2123
title: "Control-flow with pattern matching",

0 commit comments

Comments
 (0)