Skip to content

Commit e068109

Browse files
committed
09 - fix & improve ELM introtutorial
1 parent e67fa5d commit e068109

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

tutorials/09_elm-intro.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ divide_ =
110110

111111

112112
modBy_ =
113-
modBy 7 2 -- 2
113+
modBy 7 2 -- 1
114114
```
115115

116116
#### Bool and logical operators
@@ -139,7 +139,10 @@ or =
139139

140140

141141
and =
142-
False && True -- True
142+
False && True -- False
143+
144+
and =
145+
True && True -- True
143146
```
144147

145148
### Function
@@ -264,7 +267,7 @@ Or we can expose everything from the module.
264267
import Lib.Math exposing (..)
265268

266269
linearResult =
267-
Lib.Math.linear 5 3 7 -- 38
270+
linear 5 3 7 -- 38
268271
```
269272

270273
Or we can import a module with a different name.
@@ -957,14 +960,14 @@ type Msg
957960
type alias Model =
958961
Int
959962

960-
update : Msg -> Model -> ( Model, Cmd Msg )
963+
update : Msg -> Model -> Model
961964
update msg model =
962965
case msg of
963966
Increment ->
964-
( model + 1, Cmd.none )
967+
model + 1
965968

966969
Decrement ->
967-
( model - 1, Cmd.none )
970+
model - 1
968971

969972
view : Model -> Html.Html Msg
970973
view model =

0 commit comments

Comments
 (0)