From 1fb6e144c5b0975e6ba86c5c93fa3d37ab22c40e Mon Sep 17 00:00:00 2001 From: Simone Vittori Date: Wed, 9 Mar 2016 11:04:11 +0000 Subject: Fix typos --- elm.html.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'elm.html.markdown') diff --git a/elm.html.markdown b/elm.html.markdown index 944ab770..fa10671f 100644 --- a/elm.html.markdown +++ b/elm.html.markdown @@ -85,7 +85,7 @@ snd ("elm", 42) -- 42 -- Access a field with a dot and the field name. { x = 3, y = 7 }.x -- 3 --- Or with an accessor fuction, which is a dot and the field name on its own. +-- Or with an accessor function, which is a dot and the field name on its own. .y { x = 3, y = 7 } -- 7 -- Update the fields of a record. (It must have the fields already.) @@ -309,7 +309,7 @@ import Graphics.Collage as C -- An incoming port is just a type signature. port clientID : Int --- An outgoing port has a defintion. +-- An outgoing port has a definition. port clientOrders : List String port clientOrders = ["Books", "Groceries", "Furniture"] @@ -342,7 +342,7 @@ $ elm package diff evancz/elm-html 3.0.0 4.0.2 ``` The Elm language is surprisingly small. You can now look through almost any Elm -source code and have a rough idea of what is going on. However, the possibilties +source code and have a rough idea of what is going on. However, the possibilities for error-resistant and easy-to-refactor code are endless! Here are some useful resources. -- cgit v1.2.3 From a7eed36c1da2a16c7ced96e4d5fb0fb03bd94716 Mon Sep 17 00:00:00 2001 From: ven Date: Sat, 2 Jul 2016 12:43:15 +0200 Subject: fix #2295 --- elm.html.markdown | 1 + 1 file changed, 1 insertion(+) (limited to 'elm.html.markdown') diff --git a/elm.html.markdown b/elm.html.markdown index fa10671f..dab2ab34 100644 --- a/elm.html.markdown +++ b/elm.html.markdown @@ -156,6 +156,7 @@ List.map (\a -> a * 2) [1..4] -- [2, 4, 6, 8] -- You can pattern match in function definitions when there's only one case. -- This function takes one tuple rather than two arguments. +-- This is the way you'll usually unpack/extract values from tuples. area (width, height) = width * height -- cgit v1.2.3 From f835be4f02a6a855d4ade9f296fa29aaa71b647e Mon Sep 17 00:00:00 2001 From: Marcel dos Santos Date: Tue, 13 Sep 2016 13:28:53 -0300 Subject: Add file to download and correct the language used in Markdown code block (#2368) * Add file to download and correct the language used in Markdown code block * Undo the change of language as the syntax highlighter doesn't support Elm language --- elm.html.markdown | 1 + 1 file changed, 1 insertion(+) (limited to 'elm.html.markdown') diff --git a/elm.html.markdown b/elm.html.markdown index dab2ab34..96554e84 100644 --- a/elm.html.markdown +++ b/elm.html.markdown @@ -2,6 +2,7 @@ language: Elm contributors: - ["Max Goldstein", "http://maxgoldste.in/"] +filename: learnelm.elm --- Elm is a functional reactive programming language that compiles to (client-side) -- cgit v1.2.3 From e5ff868d155781c50beca2be705021257839b379 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Fro=C5=82ow?= Date: Tue, 27 Dec 2016 13:06:36 +0100 Subject: [elm/en] Fixes #2584 (#2610) --- elm.html.markdown | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'elm.html.markdown') diff --git a/elm.html.markdown b/elm.html.markdown index 96554e84..99c23980 100644 --- a/elm.html.markdown +++ b/elm.html.markdown @@ -51,18 +51,18 @@ not False -- True ["the", "quick", "brown", "fox"] [1, 2, 3, 4, 5] -- The second example can also be written with two dots. -[1..5] +List.range 1 5 -- Append lists just like strings. -[1..5] ++ [6..10] == [1..10] -- True +List.range 1 5 ++ List.range 6 10 == List.range 1 10 -- True -- To add one item, use "cons". -0 :: [1..5] -- [0, 1, 2, 3, 4, 5] +0 :: List.range 1 5 -- [0, 1, 2, 3, 4, 5] -- The head and tail of a list are returned as a Maybe. Instead of checking -- every value to see if it's null, you deal with missing values explicitly. -List.head [1..5] -- Just 1 -List.tail [1..5] -- Just [2, 3, 4, 5] +List.head (List.range 1 5) -- Just 1 +List.tail (List.range 1 5) -- Just [2, 3, 4, 5] List.head [] -- Nothing -- List.functionName means the function lives in the List module. @@ -150,10 +150,10 @@ answer = 42 -- Pass functions as arguments to other functions. -List.map double [1..4] -- [2, 4, 6, 8] +List.map double (List.range 1 4) -- [2, 4, 6, 8] -- Or write an anonymous function. -List.map (\a -> a * 2) [1..4] -- [2, 4, 6, 8] +List.map (\a -> a * 2) (List.range 1 4) -- [2, 4, 6, 8] -- You can pattern match in function definitions when there's only one case. -- This function takes one tuple rather than two arguments. @@ -180,7 +180,7 @@ fib n = else fib (n - 1) + fib (n - 2) -List.map fib [0..8] -- [1, 1, 2, 3, 5, 8, 13, 21, 34] +List.map fib (List.range 0 8) -- [1, 1, 2, 3, 5, 8, 13, 21, 34] -- Another recursive function (use List.length in real code). listLength aList = @@ -335,10 +335,10 @@ $ elm repl -- Packages are identified by GitHub username and repo name. -- Install a new package, and record it in elm-package.json. -$ elm package install evancz/elm-html +$ elm package install elm-lang/html -- See what changed between versions of a package. -$ elm package diff evancz/elm-html 3.0.0 4.0.2 +$ elm package diff elm-lang/html 1.1.0 2.0.0 -- Elm's package manager enforces semantic versioning, so minor version bumps -- will never break your build! ``` -- cgit v1.2.3